Type.createNamespace('Coveo.CES.Web.Search.Scripts.Controls'); //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.FacetScript Coveo.CES.Web.Search.Scripts.Controls.FacetScript = function Coveo_CES_Web_Search_Scripts_Controls_FacetScript() { /// /// Client side code for the Facet control. /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CES.Web.Search.Scripts.Controls.FacetScript.constructBase(this); } Coveo.CES.Web.Search.Scripts.Controls.FacetScript.prototype = { m_Main: null, m_Header: null, m_Popup: null, m_Showing: false, _m_HeaderClickDomEventHandler$1: null, _m_OnClickElsewhereEvent$1: null, initialize: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$initialize() { Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Main); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Header); this._m_HeaderClickDomEventHandler$1 = Delegate.create(this, this._header_Click$1); this.m_Header.attachEvent('onclick', this._m_HeaderClickDomEventHandler$1); if (this.m_Popup != null) { this._m_OnClickElsewhereEvent$1 = new Coveo.CNL.Web.Scripts.OnClickElsewhereEvent([ this.m_Main ], Delegate.create(this, this._main_ClickElsewhere$1), true); } }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$tearDown() { if (this._m_HeaderClickDomEventHandler$1 != null) { this.m_Header.detachEvent('onclick', this._m_HeaderClickDomEventHandler$1); this._m_HeaderClickDomEventHandler$1 = null; } if (this._m_OnClickElsewhereEvent$1 != null) { this._m_OnClickElsewhereEvent$1.dispose(); this._m_OnClickElsewhereEvent$1 = null; } }, fillItems: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$fillItems(p_Callback) { /// /// }, hideItems: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$hideItems(p_Callback) { /// /// }, _fillItemsCallback$1: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$_fillItemsCallback$1(p_Return) { /// /// Callback for when the server has filled the items. /// /// /// this.m_Showing = true; if (this.m_Popup != null) { this.m_Popup.style.display = 'block'; Coveo.CNL.Web.Scripts.DOMUtilities.positionElement(this.m_Popup, this.m_Main, Coveo.CNL.Web.Scripts.PositionEnum.belowLeft); this.m_Popup.style.visibility = 'visible'; } }, _hideItemsCallback$1: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$_hideItemsCallback$1(p_Return) { /// /// Callback for when the server has hidden the items. /// /// /// this.m_Showing = false; }, _header_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$_header_Click$1() { if (!this.m_Showing) { if (this.m_Popup != null) { this.m_Popup.style.visibility = 'hidden'; } this.fillItems(Delegate.create(this, this._fillItemsCallback$1)); } else if (this.m_Popup == null) { this.hideItems(Delegate.create(this, this._hideItemsCallback$1)); } }, _main_ClickElsewhere$1: function Coveo_CES_Web_Search_Scripts_Controls_FacetScript$_main_ClickElsewhere$1() { Coveo.CNL.Web.Scripts.CNLAssert.check(this.m_Popup != null); if (this.m_Showing) { this.m_Showing = false; this.m_Popup.style.display = 'none'; } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.ContextualDropDownScript Coveo.CES.Web.Search.Scripts.Controls.ContextualDropDownScript = function Coveo_CES_Web_Search_Scripts_Controls_ContextualDropDownScript() { /// /// Client side code for the ContextualDropDown control. /// /// /// /// /// /// /// /// /// /// /// Coveo.CES.Web.Search.Scripts.Controls.ContextualDropDownScript.constructBase(this); } Coveo.CES.Web.Search.Scripts.Controls.ContextualDropDownScript.prototype = { m_HotSpot: null, m_DropDown: null, m_IFrame: null, _m_OnClickElsewhere$1: null, _m_Showing$1: false, initialize: function Coveo_CES_Web_Search_Scripts_Controls_ContextualDropDownScript$initialize() { Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_HotSpot); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_DropDown); if (Coveo.CNL.Web.Scripts.Browser.get_isIE6()) { Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_IFrame); } this.m_HotSpot.attachEvent('onclick', Delegate.create(this, this._hotSpot_Click$1)); this.m_DropDown.attachEvent('onclick', Delegate.create(this, this._dropDown_Click$1)); }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_ContextualDropDownScript$tearDown() { this.m_HotSpot = null; this.m_DropDown = null; if (this._m_OnClickElsewhere$1 != null) { this._m_OnClickElsewhere$1.dispose(); this._m_OnClickElsewhere$1 = null; } }, _hotSpot_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_ContextualDropDownScript$_hotSpot_Click$1() { if (!this._m_Showing$1) { this.m_DropDown.style.position = 'absolute'; this.m_DropDown.style.zIndex = 999; this.m_DropDown.style.display = 'block'; Coveo.CNL.Web.Scripts.DOMUtilities.positionElement(this.m_DropDown, this.m_HotSpot, Coveo.CNL.Web.Scripts.PositionEnum.belowLeft); if (Coveo.CNL.Web.Scripts.Browser.get_isIE6()) { this.m_IFrame.style.display = 'block'; Coveo.CNL.Web.Scripts.DOMUtilities.setElementSize(this.m_IFrame, Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this.m_DropDown)); Coveo.CNL.Web.Scripts.DOMUtilities.positionElement(this.m_IFrame, this.m_HotSpot, Coveo.CNL.Web.Scripts.PositionEnum.belowLeft); } this._m_Showing$1 = true; Coveo.CNL.Web.Scripts.CNLAssert.isNull(this._m_OnClickElsewhere$1); this._m_OnClickElsewhere$1 = new Coveo.CNL.Web.Scripts.OnClickElsewhereEvent([ this.m_HotSpot, this.m_DropDown ], Delegate.create(this, this._document_ClickElsewhere$1), true); } else { this._hideDropdown$1(); } }, _dropDown_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_ContextualDropDownScript$_dropDown_Click$1() { this._hideDropdown$1(); }, _document_ClickElsewhere$1: function Coveo_CES_Web_Search_Scripts_Controls_ContextualDropDownScript$_document_ClickElsewhere$1() { this._hideDropdown$1(); }, _hideDropdown$1: function Coveo_CES_Web_Search_Scripts_Controls_ContextualDropDownScript$_hideDropdown$1() { /// /// Hides the dropdown. /// if (this._m_Showing$1) { Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_OnClickElsewhere$1); this.m_DropDown.style.display = 'none'; if (Coveo.CNL.Web.Scripts.Browser.get_isIE6()) { this.m_IFrame.style.display = 'none'; } this._m_OnClickElsewhere$1.dispose(); this._m_OnClickElsewhere$1 = null; this._m_Showing$1 = false; } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript = function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript() { /// /// Client side code for the SearchControl control. /// /// /// /// /// /// /// Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript.constructBase(this); } Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript.getInstance = function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript$getInstance(p_Id) { /// /// Retrieves an instance of the associated /// with a specific SearchControl object on the server side. /// /// /// The UniqueID of the SearchControl. /// /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Id); var found = Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._s_Instances$1[p_Id]; Coveo.CNL.Web.Scripts.CNLAssert.notNull(found); return found; } Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript.tryOpeningOutlookUri = function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript$tryOpeningOutlookUri(p_Uri, p_OnSuccess, p_OnFailure) { /// /// Tries opening an Outlook uri, and executes a piece of Javascript code /// if it is detected that the proper protocol handler is not installed. /// /// /// The outlook uri to open. /// /// /// The JavaScript code to execute on success. /// /// /// The JavaScript code to execute on failure. /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Uri); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_OnSuccess); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_OnFailure); Coveo.CNL.Web.Scripts.CNLAssert.check(Coveo.CNL.Web.Scripts.Browser.get_isIE()); var html = new StringBuilder(); html.appendLine(''); html.appendLine(''); html.appendLine(''); html.appendLine(''); html.appendLine(''); html.appendLine(''); var wnd = window.open('about:blank', '_blank', 'width=150,height=150,left=0,top=0,toolbar=no,status=no,menubar=no,location=no'); var doc = wnd.document.open('text/html'); doc.write(html.toString()); doc.close(); Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._checkWindowStatus$1(wnd, p_OnSuccess, p_OnFailure, 20); } Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._checkWindowStatus$1 = function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript$_checkWindowStatus$1(p_Window, p_OnSuccess, p_OnFailure, p_CountDown) { /// /// Checks the status of the window that is opening the outlook uri, and /// take the appropriate action if a result can be determined. Otherwise, /// arm a time to check the status again later. /// /// /// The window that is opening the Outlook uri. /// /// /// The JavaScript code to execute on success. /// /// /// The JavaScript code to execute on failure. /// /// /// Number of remaining attempts. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Window); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_OnSuccess); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_OnFailure); if (p_CountDown === 0) { p_Window.close(); } if (Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._isWindowClosed$1(p_Window)) { eval(p_OnSuccess); } else { try { var dummy = p_Window.location.href; window.setTimeout(Delegate.create(null, function() { Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._checkWindowStatus$1(p_Window, p_OnSuccess, p_OnFailure, p_CountDown - 1); }), 100); } catch ($e1) { if (Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._isWindowClosed$1(p_Window)) { Coveo.CNL.Web.Scripts.CNLAssert.check(Coveo.CNL.Web.Scripts.Browser.get_isIE6()); eval(p_OnSuccess); } else { p_Window.close(); eval(p_OnFailure); } } } } Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._isWindowClosed$1 = function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript$_isWindowClosed$1(p_Window) { /// /// Checks if a window is closed in a IE6 friendly way. /// /// /// The window to check. /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Window); var closed; try { closed = p_Window.closed; } catch ($e1) { closed = true; } return closed; } Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript.prototype = { m_Id: null, m_Prefetch: null, initialize: function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript$initialize() { Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(this.m_Id); Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._s_Instances$1[this.m_Id] = this; }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript$tearDown() { delete Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._s_Instances$1[this.m_Id]; }, startPrefetch: function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript$startPrefetch(p_Target, p_Argument) { /// /// Starts a prefetching postback. /// /// /// The postback target. /// /// /// The postback argument. /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Target); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Argument); this.invalidatePendingPrefetch(); this.m_Prefetch = Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current().doPostBack(p_Target, p_Argument, true); }, invalidatePendingPrefetch: function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript$invalidatePendingPrefetch() { /// /// Invalidates any currently pending prefetch operation. /// this.m_Prefetch = null; }, usePrefetchResultsIfPossible: function Coveo_CES_Web_Search_Scripts_Controls_SearchControlScript$usePrefetchResultsIfPossible() { /// /// Uses the results of the current prefetch operation, if any. /// /// var used; if (this.m_Prefetch != null) { this.m_Prefetch.applyPreemptivePostback(); used = true; } else { used = false; } return used; } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.CloseModalBoxLinkScript Coveo.CES.Web.Search.Scripts.Controls.CloseModalBoxLinkScript = function Coveo_CES_Web_Search_Scripts_Controls_CloseModalBoxLinkScript() { /// /// Client side code for the CloseModalBoxLink control. /// /// /// Coveo.CES.Web.Search.Scripts.Controls.CloseModalBoxLinkScript.constructBase(this); } Coveo.CES.Web.Search.Scripts.Controls.CloseModalBoxLinkScript.prototype = { _m_OnKeyPressHandler$1: null, initialize: function Coveo_CES_Web_Search_Scripts_Controls_CloseModalBoxLinkScript$initialize() { this._m_OnKeyPressHandler$1 = Delegate.create(this, this._body_KeyPress$1); document.attachEvent('onkeydown', this._m_OnKeyPressHandler$1); }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_CloseModalBoxLinkScript$tearDown() { document.detachEvent('onkeydown', this._m_OnKeyPressHandler$1); }, closeModalBox: function Coveo_CES_Web_Search_Scripts_Controls_CloseModalBoxLinkScript$closeModalBox() { /// /// Closes the modal box. /// }, _body_KeyPress$1: function Coveo_CES_Web_Search_Scripts_Controls_CloseModalBoxLinkScript$_body_KeyPress$1() { if (window.event.keyCode === 27) { window.event.cancelBubble = true; window.event.returnValue = false; this.closeModalBox(); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript = function Coveo_CES_Web_Search_Scripts_Controls_SharePointSearchBoxScript() { /// /// Client side code for the SharePoint SearchBox control. /// Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript.constructBase(this); } Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript.prototype = { initialize: function Coveo_CES_Web_Search_Scripts_Controls_SharePointSearchBoxScript$initialize() { var OurSearch = '{0}_layouts/CES/Search2007.aspx?q=\"{1}\"'; var s_MossPerson = new RegExp('(.+)Person\\.aspx.*'); var s_MossPeopleResults = new RegExp('https?://.+/PeopleResults\\.aspx\\?.*k=(\\w+:)?\"(.+)\"'); var person = s_MossPerson.exec(window.location.href); if (person != null && person.length > 0) { var elements = document.documentElement.getElementsByTagName('a'); for (var i = 0; i < elements.length; i++) { var hrefAttribute = elements[i].attributes.getNamedItem('href'); var match = s_MossPeopleResults.exec(hrefAttribute.value); if (match != null && match.length > 0) { hrefAttribute.value = String.format(OurSearch, person[1], match[2]); } } } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript = function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript() { /// /// Client side code for the SearchBox control. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// The parameter for passing the query. /// /// /// The parameter for passing the scope. /// /// /// The parameter for passing the time zone offset. /// Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript.constructBase(this); } Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript.prototype = { m_Target: null, m_SearchAsYouType: false, m_TextBox: null, m_SearchButton: null, m_LinkButton: null, m_ScopeDropDownList: null, m_ShowDelay: 0, m_HideDelay: 0, m_Position: 0, m_Popup: null, m_IFrame: null, _m_OnFocusHandler$1: null, _m_OnBlurHandler$1: null, _m_OnKeyPressHandler$1: null, _m_SearchButtonClickEventHandler$1: null, _m_LinkButtonClickEventHandler$1: null, _m_PopupOnMouseOver$1: null, _m_PopupOnMouseOut$1: null, _m_UpdateTimeout$1: null, _m_HideTimeout$1: null, _m_HasFocus$1: false, _m_OverResults$1: false, initialize: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$initialize() { Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_TextBox); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_SearchButton); this._m_OnKeyPressHandler$1 = Delegate.create(this, this._textBox_KeyPress$1); this.m_TextBox.attachEvent('onkeydown', this._m_OnKeyPressHandler$1); this._m_SearchButtonClickEventHandler$1 = Delegate.create(this, this._searchButton_Click$1); this.m_SearchButton.attachEvent('onclick', this._m_SearchButtonClickEventHandler$1); if (this.m_LinkButton != null) { this._m_LinkButtonClickEventHandler$1 = Delegate.create(this, this._linkButton_Click$1); this.m_LinkButton.attachEvent('onclick', this._m_LinkButtonClickEventHandler$1); } if (this.m_SearchAsYouType) { if (Coveo.CNL.Web.Scripts.Browser.get_isIE6()) { Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_IFrame); } Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Popup); this._m_OnFocusHandler$1 = Delegate.create(this, this._textBox_Focus$1); this.m_TextBox.attachEvent('onfocus', this._m_OnFocusHandler$1); this._m_OnBlurHandler$1 = Delegate.create(this, this._textBox_Blur$1); this.m_TextBox.attachEvent('onblur', this._m_OnBlurHandler$1); this._m_PopupOnMouseOver$1 = Delegate.create(this, this._popup_OnMouseOver$1); this.m_Popup.attachEvent('onmouseover', this._m_PopupOnMouseOver$1); this._m_PopupOnMouseOut$1 = Delegate.create(this, this._popup_OnMouseOut$1); this.m_Popup.attachEvent('onmouseout', this._m_PopupOnMouseOut$1); } }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$tearDown() { if (this._m_OnFocusHandler$1 != null) { this.m_TextBox.detachEvent('onfocus', this._m_OnFocusHandler$1); } if (this._m_OnBlurHandler$1 != null) { this.m_TextBox.detachEvent('onblur', this._m_OnBlurHandler$1); } if (this._m_OnKeyPressHandler$1 != null) { this.m_TextBox.detachEvent('onkeydown', this._m_OnKeyPressHandler$1); } if (this._m_SearchButtonClickEventHandler$1 != null) { this.m_SearchButton.detachEvent('onclick', this._m_SearchButtonClickEventHandler$1); } if (this._m_LinkButtonClickEventHandler$1 != null) { this.m_LinkButton.detachEvent('onclick', this._m_LinkButtonClickEventHandler$1); } }, serverUpdateResults: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$serverUpdateResults(p_Query, p_Scope, p_Callback) { /// /// /// /// /// /// }, _scheduleUpdateResults$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_scheduleUpdateResults$1() { /// /// Schedules an update of the results. /// this._cancelUpdateResults$1(); this._m_UpdateTimeout$1 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._updateResults$1), this.m_ShowDelay); }, _cancelUpdateResults$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_cancelUpdateResults$1() { /// /// Cancels a scheduled update of the results. /// if (this._m_UpdateTimeout$1 != null) { this._m_UpdateTimeout$1.cancel(); this._m_UpdateTimeout$1 = null; } }, _updateResults$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_updateResults$1() { /// /// Launches the server calls to update the results. /// this._m_UpdateTimeout$1 = null; if (this.m_TextBox.value !== '') { if (this.m_ScopeDropDownList != null) { this.serverUpdateResults(this.m_TextBox.value, this.m_ScopeDropDownList.value, Delegate.create(this, this._updateResultsCallback$1)); } else { this.serverUpdateResults(this.m_TextBox.value, '', Delegate.create(this, this._updateResultsCallback$1)); } } else { this._hidePopup$1(); } }, _updateResultsCallback$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_updateResultsCallback$1(p_Return) { /// /// Callback for when the server has updated the results. /// /// /// this._showPopup$1(); }, _showPopup$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_showPopup$1() { /// /// Shows the popup containing quick results. /// this.m_Popup.style.display = 'block'; Coveo.CNL.Web.Scripts.DOMUtilities.positionElement(this.m_Popup, this.m_TextBox, this.m_Position); if (Coveo.CNL.Web.Scripts.Browser.get_isIE6()) { this.m_IFrame.style.display = 'block'; Coveo.CNL.Web.Scripts.DOMUtilities.setElementSize(this.m_IFrame, Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this.m_Popup)); Coveo.CNL.Web.Scripts.DOMUtilities.positionElement(this.m_IFrame, this.m_TextBox, this.m_Position); } }, _scheduleHidePopup$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_scheduleHidePopup$1() { /// /// Schedules hiding the popup (when the user stops using the search box). /// this._cancelHidePopup$1(); this._m_HideTimeout$1 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._hidePopup$1), this.m_HideDelay); }, _cancelHidePopup$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_cancelHidePopup$1() { /// /// Cancels a scheduled hiding of the popup. /// if (this._m_HideTimeout$1 != null) { this._m_HideTimeout$1.cancel(); this._m_HideTimeout$1 = null; } }, _hidePopup$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_hidePopup$1() { /// /// Hides the popup containing quick results. /// this._cancelHidePopup$1(); this.m_Popup.style.display = 'none'; if (Coveo.CNL.Web.Scripts.Browser.get_isIE6()) { this.m_IFrame.style.display = 'none'; } }, _submitSearch$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_submitSearch$1() { /// /// Submits the current search query. /// var uri = this.m_Target; uri += '&' + Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript.querY_PARAMETER + '=' + encodeURIComponent(this.m_TextBox.value); if (this.m_ScopeDropDownList != null && this.m_ScopeDropDownList.value !== '') { uri += '&' + Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript.initiaL_SCOPE_PARAMETER + '=' + encodeURIComponent(this.m_ScopeDropDownList.value); } uri += '&' + Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript.timE_ZONE_OFFSET_PARAMETER + '=' + eval('-new Date().getTimezoneOffset()'); window.navigate(uri); }, _textBox_Focus$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_textBox_Focus$1() { this._cancelHidePopup$1(); this._m_HasFocus$1 = true; if (this.m_TextBox.value !== '') { this._scheduleUpdateResults$1(); } }, _textBox_Blur$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_textBox_Blur$1() { if (!this._m_OverResults$1) { this._scheduleHidePopup$1(); } this._cancelUpdateResults$1(); this._m_HasFocus$1 = false; }, _textBox_KeyPress$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_textBox_KeyPress$1() { if (window.event.keyCode === 13) { this._submitSearch$1(); window.event.returnValue = false; } else if (this.m_SearchAsYouType) { this._scheduleUpdateResults$1(); } }, _searchButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_searchButton_Click$1() { this._submitSearch$1(); }, _linkButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_linkButton_Click$1() { window.navigate(this.m_Target); }, _popup_OnMouseOver$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_popup_OnMouseOver$1() { this._m_OverResults$1 = true; this._cancelHidePopup$1(); }, _popup_OnMouseOut$1: function Coveo_CES_Web_Search_Scripts_Controls_SearchBoxScript$_popup_OnMouseOut$1() { if (!this._m_HasFocus$1) { this._scheduleHidePopup$1(); } this._m_OverResults$1 = false; } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.PrefetchTermScript Coveo.CES.Web.Search.Scripts.Controls.PrefetchTermScript = function Coveo_CES_Web_Search_Scripts_Controls_PrefetchTermScript() { /// /// Client side code for a control who prefetchs query terms. /// /// /// /// /// /// /// /// /// /// /// Coveo.CES.Web.Search.Scripts.Controls.PrefetchTermScript.constructBase(this); } Coveo.CES.Web.Search.Scripts.Controls.PrefetchTermScript.prototype = { m_Id: null, m_TextBox: null, m_PrefetchTimeout: null, initialize: function Coveo_CES_Web_Search_Scripts_Controls_PrefetchTermScript$initialize() { Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(this.m_Id); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_TextBox); this.m_TextBox.attachEvent('onkeyup', Delegate.create(this, this._textBox_KeyUp$1)); this.m_TextBox.attachEvent('onblur', Delegate.create(this, this._textBox_LostFocus$1)); }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_PrefetchTermScript$tearDown() { this.m_TextBox = null; }, prefetchTerms: function Coveo_CES_Web_Search_Scripts_Controls_PrefetchTermScript$prefetchTerms(p_Terms, p_Callback) { /// /// /// /// }, _textBox_KeyUp$1: function Coveo_CES_Web_Search_Scripts_Controls_PrefetchTermScript$_textBox_KeyUp$1() { this._cancelPendingPrefetch$1(); if (window.event.keyCode === 32) { this._startPrefetch$1(); } else if (window.event.keyCode !== 13) { this._schedulePrefetch$1(); } }, _textBox_LostFocus$1: function Coveo_CES_Web_Search_Scripts_Controls_PrefetchTermScript$_textBox_LostFocus$1() { this._cancelPendingPrefetch$1(); }, _schedulePrefetch$1: function Coveo_CES_Web_Search_Scripts_Controls_PrefetchTermScript$_schedulePrefetch$1() { /// /// Schedules a prefetch. /// Coveo.CNL.Web.Scripts.CNLAssert.isNull(this.m_PrefetchTimeout); this.m_PrefetchTimeout = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._startPrefetch$1), Coveo.CES.Web.Search.Scripts.Controls.PrefetchTermScript._prefetcH_DELAY$1); }, _cancelPendingPrefetch$1: function Coveo_CES_Web_Search_Scripts_Controls_PrefetchTermScript$_cancelPendingPrefetch$1() { /// /// Cancels any pending prefetch. /// if (this.m_PrefetchTimeout != null) { this.m_PrefetchTimeout.cancel(); this.m_PrefetchTimeout = null; } }, _startPrefetch$1: function Coveo_CES_Web_Search_Scripts_Controls_PrefetchTermScript$_startPrefetch$1() { /// /// Launches a terms prefetch on the server. /// this.m_PrefetchTimeout = null; if (this.m_TextBox != null) { if (this.m_TextBox.value !== '') { var terms = this.m_TextBox.value.split(' '); var newTerms = ''; for (var i = 0; i < terms.length; i++) { if (terms[i] !== '') { if (!Coveo.CES.Web.Search.Scripts.Controls.PrefetchTermScript._s_PrefetchedTerms$1.contains(terms[i])) { Coveo.CES.Web.Search.Scripts.Controls.PrefetchTermScript._s_PrefetchedTerms$1.add(terms[i]); if (newTerms.length !== 0) { newTerms += ' '; } newTerms += terms[i]; } } } if (newTerms.length !== 0) { this.prefetchTerms(newTerms, Delegate.create(this, this._prefetchTermsCallback$1)); } } } }, _prefetchTermsCallback$1: function Coveo_CES_Web_Search_Scripts_Controls_PrefetchTermScript$_prefetchTermsCallback$1(p_Return) { /// /// Callback for when the server has prefetched the terms. /// /// /// The return of the call to the server. /// } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.QueryScript Coveo.CES.Web.Search.Scripts.Controls.QueryScript = function Coveo_CES_Web_Search_Scripts_Controls_QueryScript() { /// /// Client side code for the Query control. /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CES.Web.Search.Scripts.Controls.QueryScript.constructBase(this); } Coveo.CES.Web.Search.Scripts.Controls.QueryScript.prototype = { m_Id: null, m_TextBox: null, m_SearchControlId: null, m_SearchObject: null, m_PrefetchTimeout: null, initialize: function Coveo_CES_Web_Search_Scripts_Controls_QueryScript$initialize() { Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(this.m_Id); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_TextBox); this.m_TextBox.attachEvent('onkeydown', Delegate.create(this, this._textBox_KeyPress$1)); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(this.m_SearchControlId); this.m_SearchObject = Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript.getInstance(this.m_SearchControlId); }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_QueryScript$tearDown() { this.m_TextBox = null; this.m_SearchObject = null; }, _textBox_KeyPress$1: function Coveo_CES_Web_Search_Scripts_Controls_QueryScript$_textBox_KeyPress$1() { this._cancelPendingPrefetch$1(); if (window.event.keyCode === 13) { if (this.m_SearchObject.usePrefetchResultsIfPossible()) { window.event.returnValue = false; } } else { this.m_SearchObject.invalidatePendingPrefetch(); this._schedulePrefetch$1(); } }, _schedulePrefetch$1: function Coveo_CES_Web_Search_Scripts_Controls_QueryScript$_schedulePrefetch$1() { /// /// Schedules a prefetch. /// Coveo.CNL.Web.Scripts.CNLAssert.isNull(this.m_PrefetchTimeout); this.m_PrefetchTimeout = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._startPrefetch$1), Coveo.CES.Web.Search.Scripts.Controls.QueryScript._prefetcH_DELAY$1); }, _cancelPendingPrefetch$1: function Coveo_CES_Web_Search_Scripts_Controls_QueryScript$_cancelPendingPrefetch$1() { /// /// Cancels any pending prefetch. /// if (this.m_PrefetchTimeout != null) { this.m_PrefetchTimeout.cancel(); this.m_PrefetchTimeout = null; } }, _startPrefetch$1: function Coveo_CES_Web_Search_Scripts_Controls_QueryScript$_startPrefetch$1() { /// /// Launches a prefetch on the server. /// this.m_PrefetchTimeout = null; if (this.m_TextBox.value !== '') { this.m_SearchObject.startPrefetch(this.m_Id, ''); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.HighlightedQueryScript Coveo.CES.Web.Search.Scripts.Controls.HighlightedQueryScript = function Coveo_CES_Web_Search_Scripts_Controls_HighlightedQueryScript() { /// /// Client side code for the HighlightedQuery control. /// /// /// /// /// /// /// The term control to attach the mouse events to. /// /// /// The index of the term. /// /// /// The name of the frame that contains the terms to iterate. /// Coveo.CES.Web.Search.Scripts.Controls.HighlightedQueryScript.constructBase(this); } Coveo.CES.Web.Search.Scripts.Controls.HighlightedQueryScript.prototype = { _m_MouseDownEventHandler$1: null, _m_MouseWheelEventHandler$1: null, m_Term: null, m_Index: 0, m_FrameName: null, initialize: function Coveo_CES_Web_Search_Scripts_Controls_HighlightedQueryScript$initialize() { Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Term); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(this.m_FrameName); this._m_MouseDownEventHandler$1 = Delegate.create(this, this._term_MouseDown$1); this._m_MouseWheelEventHandler$1 = Delegate.create(this, this._term_MouseWheel$1); this.m_Term.attachEvent('onmousedown', this._m_MouseDownEventHandler$1); this.m_Term.attachEvent('xxDOMMouseScroll', this._m_MouseWheelEventHandler$1); this.m_Term.attachEvent('onmousewheel', this._m_MouseWheelEventHandler$1); }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_HighlightedQueryScript$tearDown() { if (this.m_Term != null) { if (this._m_MouseDownEventHandler$1 != null) { this.m_Term.detachEvent('onmousedown', this._m_MouseDownEventHandler$1); } if (this._m_MouseWheelEventHandler$1 != null) { this.m_Term.detachEvent('xxDOMMouseScroll', this._m_MouseWheelEventHandler$1); this.m_Term.detachEvent('onmousewheel', this._m_MouseWheelEventHandler$1); } this.m_Term = null; } }, _term_MouseDown$1: function Coveo_CES_Web_Search_Scripts_Controls_HighlightedQueryScript$_term_MouseDown$1() { this._highlightNextOccurence$1(); window.event.returnValue = false; }, _term_MouseWheel$1: function Coveo_CES_Web_Search_Scripts_Controls_HighlightedQueryScript$_term_MouseWheel$1() { if (this._getMouseWheelDelta$1() < 0) { this._highlightNextOccurence$1(); } else { this._highlightPreviousOccurence$1(); } window.event.cancelBubble = true; window.event.returnValue = false; }, _getMouseWheelDelta$1: function Coveo_CES_Web_Search_Scripts_Controls_HighlightedQueryScript$_getMouseWheelDelta$1() { /// /// Get the mouse wheel delta for the current event. /// /// var wheelDelta = 0; if (Coveo.CNL.Web.Scripts.Browser.get_isFirefox()) { wheelDelta = (eval('event.detail')) * -1; } else { wheelDelta = eval('window.event.wheelDelta'); } return wheelDelta; }, _highlightNextOccurence$1: function Coveo_CES_Web_Search_Scripts_Controls_HighlightedQueryScript$_highlightNextOccurence$1() { /// /// Highlights the next occurrence of a term. /// var frame = document.getElementsByName(this.m_FrameName)[0]; if (frame != null) { frame.HighlightNextOccurence(this.m_Index); } }, _highlightPreviousOccurence$1: function Coveo_CES_Web_Search_Scripts_Controls_HighlightedQueryScript$_highlightPreviousOccurence$1() { /// /// Highlights the previous occurrence of a term. /// var frame = document.getElementsByName(this.m_FrameName)[0]; if (frame != null) { frame.HighlightPreviousOccurence(this.m_Index); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.ResultPrintableUriScript Coveo.CES.Web.Search.Scripts.Controls.ResultPrintableUriScript = function Coveo_CES_Web_Search_Scripts_Controls_ResultPrintableUriScript() { /// /// Client side code for the ResultPrintableUri control. /// /// /// /// /// /// /// Coveo.CES.Web.Search.Scripts.Controls.ResultPrintableUriScript.constructBase(this); } Coveo.CES.Web.Search.Scripts.Controls.ResultPrintableUriScript.prototype = { m_RemovedParentsTag: null, m_ReplacementStringTag: null, _m_OnClickHandler$1: null, initialize: function Coveo_CES_Web_Search_Scripts_Controls_ResultPrintableUriScript$initialize() { Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_RemovedParentsTag); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_ReplacementStringTag); this._m_OnClickHandler$1 = Delegate.create(this, this.shortenedUri_Click); this.m_ReplacementStringTag.attachEvent('onclick', this._m_OnClickHandler$1); }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_ResultPrintableUriScript$tearDown() { if (this._m_OnClickHandler$1 != null) { this.m_ReplacementStringTag.detachEvent('onclick', this._m_OnClickHandler$1); } }, shortenedUri_Click: function Coveo_CES_Web_Search_Scripts_Controls_ResultPrintableUriScript$shortenedUri_Click() { this.m_ReplacementStringTag.style.display = 'none'; this.m_RemovedParentsTag.style.display = ''; } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.ViewAsHtmlPanelScript Coveo.CES.Web.Search.Scripts.Controls.ViewAsHtmlPanelScript = function Coveo_CES_Web_Search_Scripts_Controls_ViewAsHtmlPanelScript() { /// /// Client side code for the ViewAsHtmlPanel control. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CES.Web.Search.Scripts.Controls.ViewAsHtmlPanelScript.constructBase(this); } Coveo.CES.Web.Search.Scripts.Controls.ViewAsHtmlPanelScript.prototype = { _m_BackupDocumentMargin$1: null, _m_BackupDocumentPadding$1: null, _m_BackupDocumentHeight$1: null, _m_BackupDocumentOverflow$1: null, _m_BackupBodyMargin$1: null, _m_BackupBodyPadding$1: null, _m_BackupBodyHeight$1: null, _m_BackupBodyOverflow$1: null, initialize: function Coveo_CES_Web_Search_Scripts_Controls_ViewAsHtmlPanelScript$initialize() { this._m_BackupDocumentMargin$1 = document.documentElement.style.margin; document.documentElement.style.margin = '0px'; this._m_BackupDocumentPadding$1 = document.documentElement.style.padding; document.documentElement.style.padding = '0px'; this._m_BackupDocumentHeight$1 = document.documentElement.style.height; document.documentElement.style.height = '100%'; this._m_BackupDocumentOverflow$1 = document.documentElement.style.overflow; document.documentElement.style.overflow = 'hidden'; this._m_BackupBodyMargin$1 = document.body.style.margin; document.body.style.margin = '0px'; this._m_BackupBodyPadding$1 = document.body.style.padding; document.body.style.padding = '0px'; this._m_BackupBodyHeight$1 = document.body.style.height; document.body.style.height = '100%'; this._m_BackupBodyOverflow$1 = document.body.style.overflow; document.body.style.overflow = 'hidden'; }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_ViewAsHtmlPanelScript$tearDown() { document.documentElement.style.margin = this._m_BackupDocumentMargin$1; document.documentElement.style.padding = this._m_BackupDocumentPadding$1; document.documentElement.style.height = this._m_BackupDocumentHeight$1; document.documentElement.style.overflow = this._m_BackupDocumentOverflow$1; document.body.style.margin = this._m_BackupBodyMargin$1; document.body.style.padding = this._m_BackupBodyPadding$1; document.body.style.height = this._m_BackupBodyHeight$1; document.body.style.overflow = this._m_BackupBodyOverflow$1; } } Type.createNamespace('Coveo.CES.Web.Search.Scripts.Controls.Results'); //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode = function() { /// /// Possible states for a . /// /// /// Play /// /// /// Pause /// }; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode.prototype = { play: 0, pause: 1 } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode.createEnum('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode', false); //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation = function() { /// /// Possible values for a orientation. /// /// /// Progress will be rendered from left to right /// /// /// Progress will be rendered from top to bottom /// }; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation.prototype = { horizontal: 0, vertical: 1 } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation.createEnum('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation', false); //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState = function() { /// /// Defines the different possibles states of a /// . /// /// /// Disabled /// /// /// Enabled /// /// /// Grayed /// }; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState.prototype = { disabled: 0, enabled: 1, grayed: 2 } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState.createEnum('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState', false); //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.ZoomDirection Coveo.CES.Web.Search.Scripts.Controls.Results.ZoomDirection = function() { /// /// Zooming direction possible values. /// /// /// Zoom In /// /// /// Zoom Out /// }; Coveo.CES.Web.Search.Scripts.Controls.Results.ZoomDirection.prototype = { zoomIn: 0, zoomOut: 1 } Coveo.CES.Web.Search.Scripts.Controls.Results.ZoomDirection.createEnum('Coveo.CES.Web.Search.Scripts.Controls.Results.ZoomDirection', false); //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtteranceTextEntry(p_TargetControl) { /// /// This class renders a within a . /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry.constructBase(this, [ p_TargetControl ]); } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry.prototype = { _m_TextBlock$2: null, _m_TextContainer$2: null, get_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtteranceTextEntry$get_width() { /// return Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry.callBase(this, 'get_width'); }, set_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtteranceTextEntry$set_width(value) { /// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry.callBase(this, 'set_width', [ value ]); this.set_text(this.get_text()); return value; }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtteranceTextEntry$tearDown() { this._m_TextBlock$2 = null; this._m_TextContainer$2 = null; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry.callBase(this, 'tearDown'); }, highlight: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtteranceTextEntry$highlight() { (this._m_TextBlock$2.foreground).color = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry._mousE_ENTER_TEXT_COLOR$2; }, undoHighlight: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtteranceTextEntry$undoHighlight() { this.renderControl(); }, buildTextControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtteranceTextEntry$buildTextControl() { (this.m_TargetControl).children.clear(); var utt = this.get_data(); var datetime = new Date(0, 0, 0, 0, 0, Math.truncate(utt.get_start())); var time = datetime.getHours().toString().padLeft(2, '0') + ':' + datetime.getMinutes().toString().padLeft(2, '0') + ':' + datetime.getSeconds().toString().padLeft(2, '0'); var targetWidth = this.m_TargetControl.width - 2; var containerXaml = ''; this._m_TextContainer$2 = this.m_TargetControl.getHost().content.createFromXaml(containerXaml); var xaml = '' + time + ' ' + utt.get_excerpt() + ''; this._m_TextBlock$2 = this.m_TargetControl.getHost().content.createFromXaml(xaml); this._m_TextContainer$2.children.add(this._m_TextBlock$2); this._m_TextContainer$2.height = this._m_TextBlock$2.actualHeight; this._m_TextContainer$2.width = this.m_TargetControl.width; (this.m_TargetControl).children.add(this._m_TextContainer$2); var lineXaml = ''; var lineWidth = this.m_TargetControl.width; var line = this.m_TargetControl.getHost().content.createFromXaml(lineXaml); line.x1 = 0; line.x2 = line.x1 + lineWidth; line.y1 = this._m_TextContainer$2.height + 4; line.y2 = line.y1; (this.m_TargetControl).children.add(line); this.set_height(this._m_TextContainer$2.height + 4 + line.height + 4); }, renderControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtteranceTextEntry$renderControl() { Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry.callBase(this, 'renderControl'); if (this.get_selected()) { var xaml = ''; this._m_TextContainer$2.background = this.m_TargetControl.getHost().content.createFromXaml(xaml); (this._m_TextBlock$2.foreground).color = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry._selecteD_TEXT_COLOR$2; } else { this._m_TextContainer$2.background = null; (this._m_TextBlock$2.foreground).color = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry._mousE_LEAVE_TEXT_COLOR$2; } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.TextContainerEventArgs Coveo.CES.Web.Search.Scripts.Controls.Results.TextContainerEventArgs = function Coveo_CES_Web_Search_Scripts_Controls_Results_TextContainerEventArgs() { /// /// Arguments class used for text entries related events. /// /// /// Gets or sets the object targeted by the event. /// Coveo.CES.Web.Search.Scripts.Controls.Results.TextContainerEventArgs.constructBase(this); } Coveo.CES.Web.Search.Scripts.Controls.Results.TextContainerEventArgs.prototype = { textEntry: null } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer(p_Target) { /// /// This class is used to render multiple text elements. /// /// /// /// /// /// /// /// /// this._m_TextEntries$1 = []; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer.constructBase(this, [ p_Target ]); } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer.prototype = { _m_IsUpdating$1: false, add_textEntryClick: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$add_textEntryClick(value) { /// /// Event fired when a text element is clicked. /// /// this.__textEntryClick$1 = Delegate.combine(this.__textEntryClick$1, value); }, remove_textEntryClick: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$remove_textEntryClick(value) { /// /// Event fired when a text element is clicked. /// /// this.__textEntryClick$1 = Delegate.remove(this.__textEntryClick$1, value); }, __textEntryClick$1: null, get_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$get_width() { /// return Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer.callBase(this, 'get_width'); }, set_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$set_width(value) { /// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer.callBase(this, 'set_width', [ value ]); var $enum1 = this._m_TextEntries$1.getEnumerator(); while ($enum1.moveNext()) { var textEntry = $enum1.get_current(); if (Type.canCast(textEntry, Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry)) { textEntry.set_width(this.get_width()); } } this._internalEndUpdate$1(); return value; }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$tearDown() { var $enum1 = this._m_TextEntries$1.getEnumerator(); while ($enum1.moveNext()) { var textEntry = $enum1.get_current(); textEntry.tearDown(); } this._m_TextEntries$1.clear(); this._m_TextEntries$1 = null; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer.callBase(this, 'tearDown'); }, beginUpdate: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$beginUpdate() { /// /// Call this method when you start adding entries into a object. /// This method should be use with the EndUpdate method. /// Coveo.CNL.Web.Scripts.CNLAssert.check(!this._m_IsUpdating$1); this._m_IsUpdating$1 = true; }, endUpdate: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$endUpdate() { /// /// Call this method when you the adding entries operation is terminated. /// This method should be use with the BeginUpdate method. /// Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_IsUpdating$1); this._m_IsUpdating$1 = false; this._internalEndUpdate$1(); }, clear: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$clear() { /// /// Clears the list of entries. /// var $enum1 = this._m_TextEntries$1.getEnumerator(); while ($enum1.moveNext()) { var textEntry = $enum1.get_current(); textEntry.tearDown(); } this._m_TextEntries$1.clear(); this._internalEndUpdate$1(); }, addSeparatorTextEntry: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$addSeparatorTextEntry(p_Text, p_Data, p_SelectedText) { /// /// Adds a element. When using this method, /// all added elements will be rendered on a single line separed by the " . " /// characters. /// /// /// The text to display. /// /// /// Any user object that can be attached to the text element. /// /// /// Set to True if you want the value to be rendered as selected. /// /// Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_IsUpdating$1); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Text); var containerXaml = ''; if (this._m_TextEntries$1.length > 0) { var sepContainer = this.m_TargetControl.getHost().content.createFromXaml(containerXaml); sepContainer.width = this.m_TargetControl.width; var sepEntry = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry(sepContainer); sepEntry.set_text(' . '); sepEntry.disableEvents(); this._m_TextEntries$1.add(sepEntry); } var textContainer = this.m_TargetControl.getHost().content.createFromXaml(containerXaml); textContainer.width = this.m_TargetControl.width; var textEntry = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry(textContainer); textEntry.set_data(p_Data); textEntry.set_selected(p_SelectedText); textEntry.set_text(p_Text); textEntry.add_click(Delegate.create(this, this._textEntry_Click$1)); this._m_TextEntries$1.add(textEntry); return textEntry; }, addUtteranceTextEntry: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$addUtteranceTextEntry(p_Text, p_Data, p_SelectedText) { /// /// Adds a element. When using this method, /// each added element will be rendered on a single line. /// /// /// The text to display. /// /// /// Any user object that can be attached to the text element. /// /// /// Set to True if you want the value to be rendered as selected. /// /// Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_IsUpdating$1); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Text); var containerXaml = ''; var textContainer = this.m_TargetControl.getHost().content.createFromXaml(containerXaml); textContainer.width = this.m_TargetControl.width; var textEntry = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry(textContainer); textEntry.set_data(p_Data); textEntry.set_text(p_Text); textEntry.set_selected(p_SelectedText); textEntry.add_click(Delegate.create(this, this._textEntry_Click$1)); this._m_TextEntries$1.add(textEntry); return textEntry; }, _internalEndUpdate$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$_internalEndUpdate$1() { /// /// Reorganize the output with the last changes. /// (this.m_TargetControl).children.clear(); var height = 0; var width = 0; var count = this._m_TextEntries$1.length; var top = 0; for (var i = 0; i <= count - 1; i++) { var textEntry = this._m_TextEntries$1[i]; if (width + textEntry.get_width() > this.m_TargetControl.width) { width = 0; top = height; height += textEntry.get_height(); } else { height = Math.max(height, textEntry.get_height()); } textEntry.set_left(width); textEntry.set_top(top); width += textEntry.get_width(); (this.m_TargetControl).children.add(textEntry.get_targetControl()); } this.set_height(height); }, _textEntry_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextContainer$_textEntry_Click$1(p_Sender, p_Args) { /// /// /// /// if (this.__textEntryClick$1 != null) { var args = new Coveo.CES.Web.Search.Scripts.Controls.Results.TextContainerEventArgs(); args.textEntry = p_Sender; this.__textEntryClick$1.invoke(this, args); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry(p_TargetControl) { /// /// This is the base class for any text entry created by a . /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry.constructBase(this, [ p_TargetControl ]); } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry.prototype = { _m_Selected$1: false, _m_Text$1: null, _m_Data$1: null, _m_TextBlock$1: null, get_selected: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$get_selected() { /// /// Gets or sets the value indicating that the text should appear selected or not. /// /// return this._m_Selected$1; }, set_selected: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$set_selected(value) { /// /// Gets or sets the value indicating that the text should appear selected or not. /// /// this._m_Selected$1 = value; if (this._m_TextBlock$1 != null) { if (this._m_Selected$1) { (this._m_TextBlock$1.foreground).color = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry._selecteD_TEXT_COLOR$1; this._m_TextBlock$1.fontWeight = 'bold'; } else { (this._m_TextBlock$1.foreground).color = 'Black'; this._m_TextBlock$1.fontWeight = 'normal'; } } this.renderControl(); return value; }, get_text: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$get_text() { /// /// Gets or sets the text value. /// /// return this._m_Text$1; }, set_text: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$set_text(value) { /// /// Gets or sets the text value. /// /// this._m_Text$1 = value; this.buildTextControl(); return value; }, get_data: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$get_data() { /// /// Gets or sets user data that can be attached to this object and retrieved afterwards. /// /// return this._m_Data$1; }, set_data: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$set_data(value) { /// /// Gets or sets user data that can be attached to this object and retrieved afterwards. /// /// this._m_Data$1 = value; return value; }, highlight: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$highlight() { /// /// Highlights the text. /// ((this.m_TargetControl).children.getItem(0)).textDecorations = 'underline'; }, undoHighlight: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$undoHighlight() { /// /// Removes text highlighting. /// ((this.m_TargetControl).children.getItem(0)).textDecorations = 'none'; }, buildTextControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$buildTextControl() { /// /// Creates the text control that will render the text. /// (this.m_TargetControl).children.clear(); var color = 'Black'; if (this._m_Selected$1) { color = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry._selecteD_TEXT_COLOR$1; } var xaml = ''; this._m_TextBlock$1 = this.m_TargetControl.getHost().content.createFromXaml(xaml); if (this._m_Selected$1) { this._m_TextBlock$1.fontWeight = 'bold'; } this._m_TextBlock$1.width = this.m_TargetControl.width; (this.m_TargetControl).children.add(this._m_TextBlock$1); this.m_TargetControl.height = this._m_TextBlock$1.actualHeight + 3; this.m_TargetControl.width = this._m_TextBlock$1.actualWidth; }, onMouseMove: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$onMouseMove(p_Args) { /// /// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry.callBase(this, 'onMouseMove', [ p_Args ]); this.highlight(); }, onMouseLeave: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextEntry$onMouseLeave(p_Args) { /// /// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry.callBase(this, 'onMouseLeave', [ p_Args ]); this.undoHighlight(); } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea(p_TargetCanvas) { /// /// This class is used to manipulate a scrolling area. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea.constructBase(this, [ p_TargetCanvas ]); } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea.prototype = { _m_ScrollBarControlName$1: null, _m_ScrollUpButtonName$1: null, _m_ScrollDownButtonName$1: null, _m_ScrollHookControlName$1: null, _m_ScrollHookThumbControlName$1: null, _m_ScrollTop$1: 0, _m_EnableAnimation$1: true, _m_ScrollStoryboard$1: null, _m_ScrollAnimation$1: null, _m_ScrollDownButton$1: null, _m_ScrollUpButton$1: null, _m_HookControl$1: null, _m_ScrollTarget$1: null, _m_ScrollDownButton_Click$1: null, _m_ScrollUpButton_Click$1: null, _m_HookControl_ProgressChange$1: null, get_height: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$get_height() { /// /// Gets or sets the height value of the scroll area. /// /// return Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea.callBase(this, 'get_height'); }, set_height: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$set_height(value) { /// /// Gets or sets the height value of the scroll area. /// /// (this.m_TargetControl.getHost().content.findName(this._m_ScrollBarControlName$1)).height = value; this._m_ScrollDownButton$1.set_top(value - this._m_ScrollDownButton$1.get_height()); this._m_HookControl$1.set_height(value - (this._m_ScrollDownButton$1.get_height() * 2)); var xaml = ''; var rect = this.m_TargetControl.getHost().content.createFromXaml(xaml); (this.m_TargetControl).clip = rect; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea.callBase(this, 'set_height', [ value ]); return value; }, get_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$get_width() { /// return Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea.callBase(this, 'get_width'); }, set_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$set_width(value) { /// (this.m_TargetControl.getHost().content.findName(this._m_ScrollBarControlName$1)).setValue('Canvas.Left', value - 20); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea.callBase(this, 'set_width', [ value ]); return value; }, get_scrollBarControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$get_scrollBarControlName() { /// /// Gets or sets the xaml name of the scrollbar control. /// /// return this._m_ScrollBarControlName$1; }, set_scrollBarControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$set_scrollBarControlName(value) { /// /// Gets or sets the xaml name of the scrollbar control. /// /// this._m_ScrollBarControlName$1 = value; return value; }, get_scrollUpButtonName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$get_scrollUpButtonName() { /// /// Gets or sets the xaml name of the scrollbar button up control. /// /// return this._m_ScrollUpButtonName$1; }, set_scrollUpButtonName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$set_scrollUpButtonName(value) { /// /// Gets or sets the xaml name of the scrollbar button up control. /// /// this._m_ScrollUpButtonName$1 = value; this._m_ScrollUpButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton(this.m_TargetControl.findName(this._m_ScrollUpButtonName$1)); this._m_ScrollUpButton_Click$1 = Delegate.create(this, this._scrollUpButton_Click$1); this._m_ScrollUpButton$1.add_click(this._m_ScrollUpButton_Click$1); return value; }, get_scrollDownButtonName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$get_scrollDownButtonName() { /// /// Gets or sets the xaml name of the scrollbar button down control. /// /// return this._m_ScrollDownButtonName$1; }, set_scrollDownButtonName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$set_scrollDownButtonName(value) { /// /// Gets or sets the xaml name of the scrollbar button down control. /// /// this._m_ScrollDownButtonName$1 = value; this._m_ScrollDownButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton(this.m_TargetControl.findName(this._m_ScrollDownButtonName$1)); this._m_ScrollDownButton_Click$1 = Delegate.create(this, this._scrollDownButton_Click$1); this._m_ScrollDownButton$1.add_click(this._m_ScrollDownButton_Click$1); return value; }, get_scrollHookControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$get_scrollHookControlName() { /// /// Gets or sets the xaml name of the control where the thumb slides. /// /// return this._m_ScrollHookControlName$1; }, set_scrollHookControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$set_scrollHookControlName(value) { /// /// Gets or sets the xaml name of the control where the thumb slides. /// /// this._m_ScrollHookControlName$1 = value; this._m_HookControl$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress(this.m_TargetControl.findName(this._m_ScrollHookControlName$1)); this._m_HookControl$1.set_orientation(Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation.vertical); this._m_HookControl$1.set_progressWhileDraggingThumb(true); this._m_HookControl$1.set_thumbControlName(this._m_ScrollHookThumbControlName$1); this._m_HookControl_ProgressChange$1 = Delegate.create(this, this._hookControl_ProgressChange$1); this._m_HookControl$1.add_progressChange(this._m_HookControl_ProgressChange$1); return value; }, get_scrollHookThumbControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$get_scrollHookThumbControlName() { /// /// Gets or sets the xaml name of the scrollbar thumb control. /// /// return this._m_ScrollHookThumbControlName$1; }, set_scrollHookThumbControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$set_scrollHookThumbControlName(value) { /// /// Gets or sets the xaml name of the scrollbar thumb control. /// /// this._m_ScrollHookThumbControlName$1 = value; return value; }, get_scrollTarget: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$get_scrollTarget() { /// /// Gets or sets the control that will be scrolled. /// /// return this._m_ScrollTarget$1; }, set_scrollTarget: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$set_scrollTarget(value) { /// /// Gets or sets the control that will be scrolled. /// /// var xaml = ''; this._m_ScrollStoryboard$1 = this.m_TargetControl.getHost().content.createFromXaml(xaml); (this.m_TargetControl).resources.add(this._m_ScrollStoryboard$1); this._m_ScrollAnimation$1 = this.m_TargetControl.findName('ScrollAnimation'); this._m_ScrollTarget$1 = value; return value; }, get_scrollTop: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$get_scrollTop() { /// /// Gets or sets the current top value of the scroll target. /// /// If the target control is already scrolled at the top or bottom, changing this property /// to a value that will put the target control out of bound will have no effect. /// /// /// return this._m_ScrollTop$1; }, set_scrollTop: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$set_scrollTop(value) { /// /// Gets or sets the current top value of the scroll target. /// /// If the target control is already scrolled at the top or bottom, changing this property /// to a value that will put the target control out of bound will have no effect. /// /// /// var newValue = 0; if (this._m_ScrollTarget$1.get_height() > this.get_height()) { newValue = Math.max(0, value); newValue = Math.min(this._m_ScrollTarget$1.get_height() - this.get_height(), newValue); } this._m_ScrollTop$1 = newValue; this._m_HookControl$1.updateProgress(this._m_ScrollTop$1 / (this._m_ScrollTarget$1.get_height() - this.get_height())); this.renderControl(); return value; }, scrollTo: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$scrollTo(p_TargetTop, p_MustSeeThreshold) { /// /// Scrolls the target value to the targeted top value. /// /// /// The targeted top value. /// /// /// The height that must be include when calculating the top value. /// var actualTargetTop = this._m_ScrollTarget$1.get_top() + p_TargetTop; if (actualTargetTop < 0) { this.set_scrollTop(p_TargetTop); } else if (actualTargetTop + p_MustSeeThreshold > this.get_height()) { this.set_scrollTop(this.get_scrollTop() + (actualTargetTop + p_MustSeeThreshold) - this.get_height()); } }, renderControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$renderControl() { Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea.callBase(this, 'renderControl'); if (this._m_ScrollTarget$1.get_height() <= this.get_height()) { this._m_HookControl$1.set_opacity(0); } else { this._m_HookControl$1.set_opacity(1); } if (this._m_EnableAnimation$1) { this._m_ScrollAnimation$1.from = this._m_ScrollTarget$1.get_top(); this._m_ScrollAnimation$1.to = this._m_ScrollTop$1 * -1; this._m_ScrollStoryboard$1.begin(); } else { this._m_ScrollTarget$1.set_top(this._m_ScrollTop$1 * -1); } }, onMouseWheel: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$onMouseWheel(p_WheelDelta) { /// /// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea.callBase(this, 'onMouseWheel', [ p_WheelDelta ]); if (p_WheelDelta < 0) { this._scrollDown$1(); } else { this._scrollUp$1(); } }, _scrollUp$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$_scrollUp$1() { /// /// Scrolls up the control. /// this.set_scrollTop(this.get_scrollTop() - Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea._scrolL_MOVE_SIZE$1); }, _scrollDown$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$_scrollDown$1() { /// /// Scrolls down the control. /// this.set_scrollTop(this.get_scrollTop() + Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea._scrolL_MOVE_SIZE$1); }, _scrollUpButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$_scrollUpButton_Click$1(p_Sender, p_Args) { /// /// /// /// this._scrollUp$1(); }, _scrollDownButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$_scrollDownButton_Click$1(p_Sender, p_Args) { /// /// /// /// this._scrollDown$1(); }, _hookControl_ProgressChange$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightScrollArea$_hookControl_ProgressChange$1(p_Sender, p_Args) { /// /// /// /// this._m_EnableAnimation$1 = false; try { var progress = (p_Sender).get_progress(); this.set_scrollTop((this._m_ScrollTarget$1.get_height() - this.get_height()) * progress); } finally { this._m_EnableAnimation$1 = true; } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightAnimatedButton(p_TargetControl) { /// /// Base class for all buttons providing an animation on mouse events. /// /// /// /// /// /// /// /// /// /// /// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton.constructBase(this, [ p_TargetControl ]); } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton.prototype = { _m_FocusInAnimation$2: null, _m_FocusOutAnimation$2: null, _m_PressAnimation$2: null, _m_DepressAnimation$2: null, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightAnimatedButton$tearDown() { this._m_FocusInAnimation$2 = null; this._m_FocusOutAnimation$2 = null; this._m_PressAnimation$2 = null; this._m_DepressAnimation$2 = null; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton.callBase(this, 'tearDown'); }, initialize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightAnimatedButton$initialize() { Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton.callBase(this, 'initialize'); this._m_FocusInAnimation$2 = this.m_TargetControl.getHost().content.findName(this.m_TargetControl.name + '_FocusInAnimation'); this._m_FocusOutAnimation$2 = this.m_TargetControl.getHost().content.findName(this.m_TargetControl.name + '_FocusOutAnimation'); this._m_PressAnimation$2 = this.m_TargetControl.getHost().content.findName(this.m_TargetControl.name + '_PressAnimation'); this._m_DepressAnimation$2 = this.m_TargetControl.getHost().content.findName(this.m_TargetControl.name + '_DepressAnimation'); }, onMouseEnter: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightAnimatedButton$onMouseEnter(p_Args) { /// /// if (this._m_FocusInAnimation$2 != null) { this._m_FocusInAnimation$2.begin(); } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton.callBase(this, 'onMouseEnter', [ p_Args ]); }, onMouseLeave: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightAnimatedButton$onMouseLeave(p_Args) { /// /// if (this._m_FocusOutAnimation$2 != null && !this.m_ButtonPressed) { this._m_FocusOutAnimation$2.begin(); } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton.callBase(this, 'onMouseLeave', [ p_Args ]); }, onMouseLeftButtonDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightAnimatedButton$onMouseLeftButtonDown(p_Args) { /// /// if (this._m_PressAnimation$2 != null) { this._m_PressAnimation$2.begin(); } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton.callBase(this, 'onMouseLeftButtonDown', [ p_Args ]); }, onMouseLeftButtonUp: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightAnimatedButton$onMouseLeftButtonUp(p_Args) { /// /// if (this._m_DepressAnimation$2 != null) { this._m_DepressAnimation$2.begin(); } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton.callBase(this, 'onMouseLeftButtonUp', [ p_Args ]); } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl(p_TargetControl) { /// /// Base class for all the Silverlight controls. /// /// /// Associated Silverlight control /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_TargetControl); this._m_Controls = []; this.m_TargetControl = p_TargetControl; this.initialize(); } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl.prototype = { _m_DebugControl: null, _m_LastMouseDownTime: null, _m_Dragging: false, _m_DraggingThresholdRefX: 0, _m_DraggingThresholdRefY: 0, _m_Top: 0, _m_Left: 0, _m_Height: 0, _m_Width: 0, _m_Opacity: 0, _m_Visible: false, _m_Controls: null, _m_TargetMouseEnter: null, _m_TargetMouseLeave: null, _m_TargetMouseMove: null, _m_TargetMouseLeftButtonDown: null, _m_TargetMouseLeftButtonUp: null, _m_MouseWheel: null, m_MouseOver: false, m_MouseWheelDelta: 0, m_ButtonPressed: false, m_TargetControl: null, add_beginDrag: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$add_beginDrag(value) { /// /// Event fired when a dragging operation starts. /// /// this.__beginDrag = Delegate.combine(this.__beginDrag, value); }, remove_beginDrag: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$remove_beginDrag(value) { /// /// Event fired when a dragging operation starts. /// /// this.__beginDrag = Delegate.remove(this.__beginDrag, value); }, __beginDrag: null, add_mouseEnter: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$add_mouseEnter(value) { /// /// Event fired when the mouse enters the control. /// /// this.__mouseEnter = Delegate.combine(this.__mouseEnter, value); }, remove_mouseEnter: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$remove_mouseEnter(value) { /// /// Event fired when the mouse enters the control. /// /// this.__mouseEnter = Delegate.remove(this.__mouseEnter, value); }, __mouseEnter: null, add_mouseLeave: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$add_mouseLeave(value) { /// /// Event fired when the mouse leaves the control. /// /// this.__mouseLeave = Delegate.combine(this.__mouseLeave, value); }, remove_mouseLeave: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$remove_mouseLeave(value) { /// /// Event fired when the mouse leaves the control. /// /// this.__mouseLeave = Delegate.remove(this.__mouseLeave, value); }, __mouseLeave: null, add_mouseMove: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$add_mouseMove(value) { /// /// Event fired when the mouse moves over the control. /// /// this.__mouseMove = Delegate.combine(this.__mouseMove, value); }, remove_mouseMove: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$remove_mouseMove(value) { /// /// Event fired when the mouse moves over the control. /// /// this.__mouseMove = Delegate.remove(this.__mouseMove, value); }, __mouseMove: null, add_dragging: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$add_dragging(value) { /// /// Event fired while the control is dragged. /// /// this.__dragging = Delegate.combine(this.__dragging, value); }, remove_dragging: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$remove_dragging(value) { /// /// Event fired while the control is dragged. /// /// this.__dragging = Delegate.remove(this.__dragging, value); }, __dragging: null, add_dragDrop: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$add_dragDrop(value) { /// /// Event fired when the drag operation ends. /// /// this.__dragDrop = Delegate.combine(this.__dragDrop, value); }, remove_dragDrop: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$remove_dragDrop(value) { /// /// Event fired when the drag operation ends. /// /// this.__dragDrop = Delegate.remove(this.__dragDrop, value); }, __dragDrop: null, add_click: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$add_click(value) { /// /// Event fired when the control is clicked. A click operation is defined by /// a MouseDown action followed by a MouseUp while the mouse is over the /// control an no dragging operation was done. /// /// this.__click = Delegate.combine(this.__click, value); }, remove_click: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$remove_click(value) { /// /// Event fired when the control is clicked. A click operation is defined by /// a MouseDown action followed by a MouseUp while the mouse is over the /// control an no dragging operation was done. /// /// this.__click = Delegate.remove(this.__click, value); }, __click: null, add_doubleClick: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$add_doubleClick(value) { /// /// Event fired when the control is clicked. A double click operation is /// defined by two consecutive MouseDown actions in a small period of time. /// /// this.__doubleClick = Delegate.combine(this.__doubleClick, value); }, remove_doubleClick: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$remove_doubleClick(value) { /// /// Event fired when the control is clicked. A double click operation is /// defined by two consecutive MouseDown actions in a small period of time. /// /// this.__doubleClick = Delegate.remove(this.__doubleClick, value); }, __doubleClick: null, get_targetControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_targetControl() { /// /// Gets the Silverlight target control /// /// return this.m_TargetControl; }, get_controls: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_controls() { /// /// Gets the list of the child controls. /// /// return this._m_Controls; }, get_debugControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_debugControl() { /// /// Gets or sets the debug control attached to the component. /// /// return this._m_DebugControl; }, set_debugControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$set_debugControl(value) { /// /// Gets or sets the debug control attached to the component. /// /// this._m_DebugControl = value; return value; }, get_isDragging: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_isDragging() { /// /// Indicates that the control is currently dragged. This property is /// read/only. /// /// return this._m_Dragging; }, get_top: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_top() { /// /// Gets or sets the control top value. /// /// this._m_Top = this.m_TargetControl.getValue('Canvas.Top'); return this._m_Top; }, set_top: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$set_top(value) { /// /// Gets or sets the control top value. /// /// this._m_Top = value; this.renderControl(); return value; }, get_left: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_left() { /// /// Gets or sets the control left value. /// /// this._m_Left = this.m_TargetControl.getValue('Canvas.Left'); return this._m_Left; }, set_left: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$set_left(value) { /// /// Gets or sets the control left value. /// /// this._m_Left = value; this.renderControl(); return value; }, get_height: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_height() { /// /// Gets or sets the control height value. /// /// this._m_Height = this.m_TargetControl.height; return this._m_Height; }, set_height: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$set_height(value) { /// /// Gets or sets the control height value. /// /// this._m_Height = value; this.renderControl(); return value; }, get_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_width() { /// /// Gets or sets the control width value. /// /// this._m_Width = this.m_TargetControl.width; return this._m_Width; }, set_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$set_width(value) { /// /// Gets or sets the control width value. /// /// this._m_Width = value; this.renderControl(); return value; }, get_opacity: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_opacity() { /// /// Gets or sets the control opacity value. /// /// this._m_Opacity = this.m_TargetControl.opacity; return this._m_Opacity; }, set_opacity: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$set_opacity(value) { /// /// Gets or sets the control opacity value. /// /// this._m_Opacity = value; this.renderControl(); return value; }, get_visible: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$get_visible() { /// /// Gets or sets the visibility value. /// /// this._m_Visible = this.m_TargetControl.visibility === 'visible'; return this._m_Visible; }, set_visible: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$set_visible(value) { /// /// Gets or sets the visibility value. /// /// this._m_Visible = value; this.renderControl(); return value; }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$tearDown() { /// /// Call this method to release associated objects. /// window.detachEvent('onmousewheel', this._m_MouseWheel); this.m_TargetControl.removeEventListener('mouseEnter', this._m_TargetMouseEnter); this.m_TargetControl.removeEventListener('mouseLeave', this._m_TargetMouseLeave); this.m_TargetControl.removeEventListener('mouseMove', this._m_TargetMouseMove); this.m_TargetControl.removeEventListener('mouseLeftButtonDown', this._m_TargetMouseLeftButtonDown); this.m_TargetControl.removeEventListener('mouseLeftButtonUp', this._m_TargetMouseLeftButtonUp); var $enum1 = this._m_Controls.getEnumerator(); while ($enum1.moveNext()) { var control = $enum1.get_current(); control.tearDown(); } this._m_DebugControl = null; this.m_TargetControl = null; }, disableEvents: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$disableEvents() { /// /// Call this method to disable all custom events fired by the control. /// this.m_TargetControl.isHitTestVisible = false; }, initialize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$initialize() { /// /// Retrieves attributes manipulated by the control class and also set /// different event handlers. /// this._m_Top = this.m_TargetControl.getValue('Canvas.Top'); this._m_Left = this.m_TargetControl.getValue('Canvas.Left'); this._m_Height = this.m_TargetControl.height; this._m_Width = this.m_TargetControl.width; this._m_Opacity = this.m_TargetControl.opacity; this._m_Visible = this.m_TargetControl.visibility === 'visible'; this._m_TargetMouseEnter = this.m_TargetControl.addEventListener('mouseEnter', Delegate.create(this, this._targetMouseEnter)); this._m_TargetMouseLeave = this.m_TargetControl.addEventListener('mouseLeave', Delegate.create(this, this._targetMouseLeave)); this._m_TargetMouseMove = this.m_TargetControl.addEventListener('mouseMove', Delegate.create(this, this._targetMouseMove)); this._m_TargetMouseLeftButtonDown = this.m_TargetControl.addEventListener('mouseLeftButtonDown', Delegate.create(this, this._targetMouseLeftButtonDown)); this._m_TargetMouseLeftButtonUp = this.m_TargetControl.addEventListener('mouseLeftButtonUp', Delegate.create(this, this._targetMouseLeftButtonUp)); this._m_MouseWheel = Delegate.create(this, this._window_MouseWheel); this.m_TargetControl.getHost().attachEvent('onmousewheel', this._m_MouseWheel); }, renderControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$renderControl() { /// /// Renders the target control. /// this.m_TargetControl.setValue('Canvas.Top', this._m_Top); this.m_TargetControl.setValue('Canvas.Left', this._m_Left); this.m_TargetControl.height = this._m_Height; this.m_TargetControl.width = this._m_Width; this.m_TargetControl.opacity = this._m_Opacity; if (this._m_Visible) { this.m_TargetControl.visibility = 'visible'; } else { this.m_TargetControl.visibility = 'collapsed'; } }, ensureBoudaries: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$ensureBoudaries() { /// /// Ensures that the internally kept properties are synchronized with the /// ones of the control. You may call this method if you think, for example, /// that the left property of the control might have change, even if you /// don't explicitly set the Left property (e.g. Control has moved in result /// of a binded Animation). /// this._m_Left = this.m_TargetControl.getValue('Canvas.Left'); this._m_Top = this.m_TargetControl.getValue('Canvas.Top'); this._m_Height = this.m_TargetControl.height; this._m_Width = this.m_TargetControl.width; }, onClick: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onClick(p_Args) { /// /// Performs action when the control is clicked and then fires the event. /// /// /// Mouse arguments. /// if (this.__click != null) { this.__click.invoke(this, new EventArgs()); } }, onDoubleClick: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onDoubleClick(p_Args) { /// /// Performs action when the control is double clicked and then fires the event. /// /// /// Mouse arguments. /// if (this.__doubleClick != null) { this.__doubleClick.invoke(this, new EventArgs()); } }, onMouseEnter: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onMouseEnter(p_Args) { /// /// Performs action when the mouse enters the control and then fires the /// event. /// /// /// Mouse arguments. /// if (this.__mouseEnter != null) { this.__mouseEnter.invoke(this, p_Args); } }, onMouseLeave: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onMouseLeave(p_Args) { /// /// Performs action when the mouse leaves the control and then fires the /// event. /// /// /// Mouse arguments. /// if (this.__mouseLeave != null) { this.__mouseLeave.invoke(this, p_Args); } }, onMouseMove: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onMouseMove(p_Args) { /// /// Performs action when the mouse moves over the control and then fires the /// event. /// /// /// Mouse arguments. /// if (this.__mouseMove != null) { this.__mouseMove.invoke(this, p_Args); } }, onMouseLeftButtonDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onMouseLeftButtonDown(p_Args) { /// /// Performs action when the mouse left button is pressed and then fires the /// event. /// /// /// Mouse arguments. /// }, onMouseLeftButtonUp: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onMouseLeftButtonUp(p_Args) { /// /// Performs action when the mouse left button is depressed and then fires the /// event. /// /// /// Mouse arguments. /// }, onBeginDrag: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onBeginDrag(p_Args) { /// /// Performs action when a drag operation is started on a control and the /// fires the event. /// /// /// Mouse arguments. /// if (this.__beginDrag != null) { this.__beginDrag.invoke(this, p_Args); } }, onDragging: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onDragging(p_Args) { /// /// Performs action when the control is dragged and then fires the event. /// /// /// Mouse arguments. /// if (this.__dragging != null) { this.__dragging.invoke(this, p_Args); } }, onDragDrop: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onDragDrop(p_Args) { /// /// Performs action when the drag operation is completed and then fires the /// event. /// /// /// Mouse arguments. /// if (this.__dragDrop != null) { this.__dragDrop.invoke(this, p_Args); } }, onMouseWheel: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$onMouseWheel(p_WheelDelta) { /// /// Performs action when a mouse wheel operation is processed. /// /// /// }, _targetMouseEnter: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$_targetMouseEnter(p_Sender, p_Args) { /// /// /// /// this.m_MouseOver = true; this.onMouseEnter(p_Args); }, _targetMouseLeave: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$_targetMouseLeave(p_Sender, p_Args) { /// /// /// /// this.m_MouseOver = false; this.onMouseLeave(p_Args); }, _targetMouseMove: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$_targetMouseMove(p_Sender, p_Args) { /// /// /// /// if (this.m_ButtonPressed) { var wasDragging = this._m_Dragging; this._m_Dragging = this._m_Dragging || (Math.abs(this._m_DraggingThresholdRefX - p_Args.getPosition(this.m_TargetControl).x) >= Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl._draG_MOUSE_THRESHOLD) || (Math.abs(this._m_DraggingThresholdRefY - p_Args.getPosition(this.m_TargetControl).y) >= Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl._draG_MOUSE_THRESHOLD); if (this._m_Dragging) { if (!wasDragging) { this.onBeginDrag(p_Args); } this.onDragging(p_Args); } } this.onMouseMove(p_Args); }, _targetMouseLeftButtonDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$_targetMouseLeftButtonDown(p_Sender, p_Args) { /// /// /// /// var currentTime = new Date(); if (this._m_LastMouseDownTime != null && currentTime.getTime() - this._m_LastMouseDownTime.getTime() <= 300) { this.onDoubleClick(p_Args); } else { this._m_LastMouseDownTime = currentTime; this.m_TargetControl.captureMouse(); this.m_ButtonPressed = true; this._m_DraggingThresholdRefX = p_Args.getPosition(this.m_TargetControl).x; this._m_DraggingThresholdRefY = p_Args.getPosition(this.m_TargetControl).y; this.onMouseLeftButtonDown(p_Args); } }, _targetMouseLeftButtonUp: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$_targetMouseLeftButtonUp(p_Sender, p_Args) { /// /// /// /// this.m_TargetControl.releaseMouseCapture(); this.m_ButtonPressed = false; if (this._m_Dragging) { this._m_Dragging = false; this.onMouseLeftButtonUp(p_Args); this.onDragDrop(p_Args); } else if (this.m_MouseOver) { this.onMouseLeftButtonUp(p_Args); this.onClick(p_Args); } }, _window_MouseWheel: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightCustomControl$_window_MouseWheel() { if (this.m_MouseOver) { eval('this.m_MouseWheelDelta = window.event.wheelDelta;'); this.onMouseWheel(this.m_MouseWheelDelta); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButton Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButton = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightButton(p_TargetCanvas) { /// /// Base class for all buttons Silverlight controls. /// /// /// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButton.constructBase(this, [ p_TargetCanvas ]); } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightDebug Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightDebug = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightDebug(p_TargetControl) { /// /// This control is used to display debug information on a Silverlight module. /// /// /// /// /// /// /// this._m_Array$1 = []; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightDebug.constructBase(this, [ p_TargetControl ]); } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightDebug.prototype = { _m_DebugText$1: null, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightDebug$tearDown() { this._m_Array$1.clear(); this._m_Array$1 = null; this._m_DebugText$1 = null; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightDebug.callBase(this, 'tearDown'); }, turnOn: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightDebug$turnOn() { /// /// Turns on the debug control. /// this.m_TargetControl.opacity = 0.75; }, turnOff: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightDebug$turnOff() { /// /// Turns off the debug control. /// this.m_TargetControl.opacity = 0; }, log: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightDebug$log(p_DebugLog) { /// /// Adds a new log entry to be displayed by the debug control. /// /// /// The log to display. /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_DebugLog); this._m_Array$1.add(p_DebugLog); var start = 0; var end = this._m_Array$1.length; if (end > 20) { start = this._m_Array$1.length - 20; } var sb = new StringBuilder(); for (var i = start; i <= end - 1; i++) { sb.appendLine(this._m_Array$1[i].toString()); } this._m_DebugText$1.text = sb.toString(); }, initialize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightDebug$initialize() { Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightDebug.callBase(this, 'initialize'); this._m_Array$1.add('Debug On...'); this._m_DebugText$1 = this.m_TargetControl.findName('DebugText'); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_DebugText$1); this.m_TargetControl.opacity = 0.75; } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip(p_Target) { /// /// Class used to render a time value. /// /// /// /// /// /// /// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.constructBase(this, [ p_Target ]); } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.prototype = { _m_Rectangle$1: null, _m_Text$1: null, get_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip$get_width() { /// return Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.callBase(this, 'get_width'); }, set_width: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip$set_width(value) { /// this._m_Rectangle$1.width = value; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.callBase(this, 'set_width', [ value ]); return value; }, get_height: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip$get_height() { /// return Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.callBase(this, 'get_height'); }, set_height: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip$set_height(value) { /// this._m_Rectangle$1.height = value; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.callBase(this, 'set_height', [ value ]); return value; }, get_text: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip$get_text() { /// /// Gets or sets the text value rendered by the control. /// /// return this._m_Text$1; }, set_text: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip$set_text(value) { /// /// Gets or sets the text value rendered by the control. /// /// this._m_Text$1 = value; this.renderControl(); return value; }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip$tearDown() { this._m_Rectangle$1 = null; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.callBase(this, 'tearDown'); }, initialize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip$initialize() { Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.callBase(this, 'initialize'); this._m_Rectangle$1 = this.m_TargetControl.findName('ExcerptRect'); }, renderControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightExcerptTooltip$renderControl() { Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.callBase(this, 'renderControl'); (this.m_TargetControl).children.clear(); (this.m_TargetControl).children.add(this._m_Rectangle$1); var xaml = '' + this._m_Text$1 + ''; var textBlock = this.m_TargetControl.getHost().content.createFromXaml(xaml); (this.m_TargetControl).children.add(textBlock); var clipXaml = ''; var clipRect = this.m_TargetControl.getHost().content.createFromXaml(clipXaml); (this.m_TargetControl).clip = clipRect; } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayerControl Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayerControl = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl() { /// /// This is the main class used to manage the Silverlight media player. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// Unable to play error message. /// this._m_Concepts$1 = []; this._m_Utterances$1 = []; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayerControl.constructBase(this); } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayerControl.prototype = { _m_UtterancesDirty$1: false, _m_LastSelectedUtterance$1: null, _m_LastHighlightUtterance$1: null, _m_HeadStartAsPercent$1: 0, _m_Loaded$1: false, _m_LastSelectedConcept$1: null, _m_DebugControl$1: null, _m_UtterancesCanvas$1: null, _m_PlayerControls$1: null, _m_MediaPlayer$1: null, _m_PlayerControlsFadeInAnimation$1: null, _m_PlayerControlsFadeOutInAnimation$1: null, _m_ProgressTimer$1: null, _m_MarkerLeftTimer$1: null, _m_AudioVisualAnimationFadeIn$1: null, _m_AudioVisualAnimationFadeOut$1: null, _m_FullScreenHook$1: null, _m_TotalTimeText$1: null, _m_CurrentTimeText$1: null, _m_PlayPauseButton$1: null, _m_ProgressControl$1: null, _m_DownloadControl$1: null, _m_VolumeControl$1: null, _m_MarkersZoomButton$1: null, _m_MarkerContainer$1: null, _m_FullScreenButton$1: null, _m_StopButton$1: null, _m_NextButton$1: null, _m_PreviousButton$1: null, _m_MuteButton$1: null, _m_VolumeDownButton$1: null, _m_VolumeUpButton$1: null, _m_ExcerptTooltip$1: null, _m_ConceptsControl$1: null, _m_UtteranceContainer$1: null, _m_ScrollArea$1: null, _m_PlayerControls_MouseEnter$1: null, _m_PlayerControls_MouseLeave$1: null, _m_MediaPlayer_MediaOpened$1: null, _m_MediaPlayer_MarkerReached$1: null, _m_MediaPlayer_CurrentStateChanged$1: null, _m_MediaPlayer_BufferingProgressChanged$1: null, _m_MediaPlayer_DownloadProgressChanged$1: null, _m_MediaPlayer_MediaFailed$1: null, _m_MediaPlayer_MediaEnded$1: null, _m_ProgressTimer_Completed$1: null, _m_MarkerLeftTimer_Completed$1: null, _m_AudioVisualFadeIn_Completed$1: null, _m_AudioVisualFadeOut_Completed$1: null, _m_FullScreenButton_Click$1: null, _m_MarkersZoom_Click$1: null, _m_PlayPauseButton_Click$1: null, _m_StopButton_Click$1: null, _m_NextButton_Click$1: null, _m_PreviousButton_Click$1: null, _m_ProgressControl_ProgressChange$1: null, _m_MarkerContainer_UtteranceHighlighted$1: null, _m_MarkerContainer_UtteranceClick$1: null, _m_MuteButton_Click$1: null, _m_VolumeDownButton_Click$1: null, _m_VolumeUpButton_Click$1: null, _m_VolumeControl_ProgressChange$1: null, m_Control: null, m_MediaUri: null, m_MediaLength: 0, m_PlayerXaml: null, m_HeadStart: 0, m_PlayerWidth: 0, m_PlayerHeight: 0, m_Debug: false, m_SelectedConcept: null, m_PartialCallbackMethod: null, m_AudioFileOnly: false, m_SearchControls: null, m_SearchTextBox: null, m_SearchButton: null, m_Host: null, initialize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$initialize() { Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_SearchControls); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_Host); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(this.m_PlayerXaml); if (!SilverlightPlugin.isInstalled()) { this.m_SearchControls.style.display = 'none'; } var pluginParams = SilverlightPlugin.createParams(this.m_PlayerXaml, this.m_Host); pluginParams.id = this.m_Host.id + 'SilverlightPlugIn'; pluginParams.style = 'width:' + this.m_PlayerWidth.toString() + 'px;height:' + this.m_PlayerHeight.toString() + 'px;'; this.m_Control = SilverlightPlugin.createInstance(pluginParams, Delegate.create(this, this.onSilverlightLoad)); }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$tearDown() { if (this.m_Control == null) { return; } this._m_PlayerControls$1.removeEventListener('mouseEnter', this._m_PlayerControls_MouseEnter$1); this._m_PlayerControls$1.removeEventListener('mouseLeave', this._m_PlayerControls_MouseLeave$1); this._m_MediaPlayer$1.stop(); this._m_MediaPlayer$1.removeEventListener('mediaOpened', this._m_MediaPlayer_MediaOpened$1); this._m_MediaPlayer$1.removeEventListener('markerReached', this._m_MediaPlayer_MarkerReached$1); this._m_MediaPlayer$1.removeEventListener('currentStateChanged', this._m_MediaPlayer_CurrentStateChanged$1); this._m_MediaPlayer$1.removeEventListener('bufferingProgressChanged', this._m_MediaPlayer_BufferingProgressChanged$1); this._m_MediaPlayer$1.removeEventListener('downloadProgressChanged', this._m_MediaPlayer_DownloadProgressChanged$1); this._m_MediaPlayer$1.removeEventListener('mediaFailed', this._m_MediaPlayer_MediaFailed$1); this._m_MediaPlayer$1.removeEventListener('mediaEnded', this._m_MediaPlayer_MediaEnded$1); this._m_ProgressTimer$1.removeEventListener('completed', this._m_ProgressTimer_Completed$1); this._m_MarkerLeftTimer$1.removeEventListener('completed', this._m_MarkerLeftTimer_Completed$1); this._m_FullScreenButton$1.remove_click(this._m_FullScreenButton_Click$1); this._m_MarkersZoomButton$1.remove_click(this._m_MarkersZoom_Click$1); this._m_PlayPauseButton$1.remove_click(this._m_PlayPauseButton_Click$1); this._m_StopButton$1.remove_click(this._m_StopButton_Click$1); this._m_NextButton$1.remove_click(this._m_NextButton_Click$1); this._m_PreviousButton$1.remove_click(this._m_PreviousButton_Click$1); this._m_ProgressControl$1.remove_progressChange(this._m_ProgressControl_ProgressChange$1); this._m_MarkerContainer$1.remove_utteranceHighlighted(this._m_MarkerContainer_UtteranceHighlighted$1); this._m_MarkerContainer$1.remove_utteranceClick(this._m_MarkerContainer_UtteranceClick$1); this._m_MuteButton$1.remove_click(this._m_MuteButton_Click$1); this._m_VolumeDownButton$1.remove_click(this._m_VolumeDownButton_Click$1); this._m_VolumeUpButton$1.remove_click(this._m_VolumeUpButton_Click$1); this._m_VolumeControl$1.remove_progressChange(this._m_VolumeControl_ProgressChange$1); this.m_MediaUri = null; this.m_PlayerXaml = null; this.m_SearchControls = null; this.m_Host = null; this._m_UtterancesCanvas$1 = null; this._m_ProgressTimer$1.stop(); this._m_MarkerLeftTimer$1.stop(); this._m_MediaPlayer$1.source = null; this._m_MediaPlayer$1 = null; this._m_Utterances$1.clear(); this._m_Utterances$1 = null; this._m_LastSelectedUtterance$1 = null; this._m_LastHighlightUtterance$1 = null; this.m_Control.content.onFullScreenChange = null; this.m_Control.content.onResize = null; this.m_Control = null; this._m_DebugControl$1.tearDown(); this._m_DebugControl$1 = null; this._m_PlayerControls$1 = null; this._m_PlayerControlsFadeInAnimation$1 = null; this._m_PlayerControlsFadeOutInAnimation$1 = null; this._m_ProgressTimer$1 = null; this._m_MarkerLeftTimer$1 = null; this._m_ExcerptTooltip$1.tearDown(); this._m_ExcerptTooltip$1 = null; this._m_FullScreenHook$1.tearDown(); this._m_FullScreenHook$1 = null; this._m_TotalTimeText$1.tearDown(); this._m_TotalTimeText$1 = null; this._m_CurrentTimeText$1.tearDown(); this._m_CurrentTimeText$1 = null; this._m_PlayPauseButton$1.tearDown(); this._m_PlayPauseButton$1 = null; this._m_ProgressControl$1.tearDown(); this._m_ProgressControl$1 = null; this._m_DownloadControl$1.tearDown(); this._m_DownloadControl$1 = null; this._m_VolumeControl$1.tearDown(); this._m_VolumeControl$1 = null; this._m_MarkersZoomButton$1.tearDown(); this._m_MarkersZoomButton$1 = null; this._m_MarkerContainer$1.tearDown(); this._m_MarkerContainer$1 = null; this._m_FullScreenButton$1.tearDown(); this._m_FullScreenButton$1 = null; this._m_StopButton$1.tearDown(); this._m_StopButton$1 = null; this._m_NextButton$1.tearDown(); this._m_NextButton$1 = null; this._m_PreviousButton$1.tearDown(); this._m_PreviousButton$1 = null; this._m_MuteButton$1.tearDown(); this._m_MuteButton$1 = null; this._m_VolumeDownButton$1.tearDown(); this._m_VolumeDownButton$1 = null; this._m_VolumeUpButton$1.tearDown(); this._m_VolumeUpButton$1 = null; this._m_ConceptsControl$1.tearDown(); this._m_ConceptsControl$1 = null; this._m_UtteranceContainer$1.tearDown(); this._m_UtteranceContainer$1 = null; this._m_ScrollArea$1.tearDown(); this._m_ScrollArea$1 = null; if (this.m_AudioFileOnly) { this._m_AudioVisualAnimationFadeIn$1.removeEventListener('completed', this._m_AudioVisualFadeIn_Completed$1); this._m_AudioVisualAnimationFadeOut$1.removeEventListener('completed', this._m_AudioVisualFadeOut_Completed$1); } this._m_AudioVisualAnimationFadeIn$1 = null; this._m_AudioVisualAnimationFadeOut$1 = null; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayerControl.callBase(this, 'tearDown'); }, addConcept: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$addConcept(p_Concept) { /// /// Adds a new concept to the collection. /// /// /// The concept text. /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Concept); this._m_Concepts$1.add(p_Concept); }, addUtterance: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$addUtterance(p_Start, p_Percent, p_Excerpt) { /// /// Adds a new utterance to the collection. /// /// /// The start position in seconds. /// /// /// The start position represented as a percentage. /// /// /// The excerpt of the utterance. /// Coveo.CNL.Web.Scripts.CNLAssert.check(p_Start >= 0); Coveo.CNL.Web.Scripts.CNLAssert.check(p_Percent >= 0 && p_Percent <= 1); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Excerpt); this._m_Utterances$1.add(new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtterance(p_Start, p_Percent, p_Excerpt)); }, onSilverlightLoad: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$onSilverlightLoad(p_Control, p_UserContext) { /// /// /// /// if (this._m_Loaded$1) { return; } this.m_Control = p_Control; this.m_Control.content.onFullScreenChange = Delegate.create(this, this.control_FullScreenChange); this.m_Control.content.onResize = Delegate.create(this, this.control_Resize); this._m_DebugControl$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightDebug(this.m_Control.content.findName('Debug')); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_DebugControl$1); if (this.m_Debug) { this._m_DebugControl$1.turnOn(); } else { this._m_DebugControl$1.turnOff(); } this._m_UtterancesCanvas$1 = this.m_Control.content.findName('Utterances'); this._m_UtteranceContainer$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer(this.m_Control.content.findName('UtteranceContainer')); this._m_UtteranceContainer$1.add_textEntryClick(Delegate.create(this, this._utteranceContainer_UtteranceClick$1)); this._m_ConceptsControl$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer(this.m_Control.content.findName('Concepts')); this._m_ConceptsControl$1.add_textEntryClick(Delegate.create(this, this._conceptsControl_TextEntryClick$1)); this._m_ScrollArea$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea(this.m_Control.content.findName('UtterancesScrollArea')); this._m_ScrollArea$1.set_scrollBarControlName('UtterancesScrollBar'); this._m_ScrollArea$1.set_scrollUpButtonName('UtterancesUpButton'); this._m_ScrollArea$1.set_scrollDownButtonName('UtterancesDownButton'); this._m_ScrollArea$1.set_scrollHookThumbControlName('UtterancesThumb'); this._m_ScrollArea$1.set_scrollHookControlName('UtterancesScrollHook'); this._m_ScrollArea$1.set_scrollTarget(this._m_UtteranceContainer$1); this._m_PlayerControls$1 = this.m_Control.content.findName('PlayerControls'); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_PlayerControls$1); this._m_PlayerControls_MouseEnter$1 = this._m_PlayerControls$1.addEventListener('mouseEnter', Delegate.create(this, this._playerControls_MouseEnter$1)); this._m_PlayerControls_MouseLeave$1 = this._m_PlayerControls$1.addEventListener('mouseLeave', Delegate.create(this, this._playerControls_MouseLeave$1)); this._m_PlayerControlsFadeInAnimation$1 = this.m_Control.content.findName('PlayerControlsFadeIn'); this._m_PlayerControlsFadeOutInAnimation$1 = this.m_Control.content.findName('PlayerControlsFadeOut'); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_PlayerControlsFadeInAnimation$1); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_PlayerControlsFadeOutInAnimation$1); this._m_FullScreenButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButton(this.m_Control.content.findName('FullScreenButton')); this._m_FullScreenButton_Click$1 = Delegate.create(this, this._fullScreenButton_Click$1); this._m_FullScreenButton$1.add_click(this._m_FullScreenButton_Click$1); this._m_MarkersZoomButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton(this.m_Control.content.findName('MarkerZoomButton')); this._m_MarkersZoomButton$1.set_state(Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState.grayed); this._m_MarkersZoom_Click$1 = Delegate.create(this, this._markersZoom_Click$1); this._m_MarkersZoomButton$1.add_click(this._m_MarkersZoom_Click$1); this._m_FullScreenHook$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl(this.m_Control.content.findName('PlayerCanvas')); this._m_FullScreenHook$1.add_doubleClick(Delegate.create(this, this._fullScreenHook_DoubleClick$1)); this._m_MediaPlayer$1 = this.m_Control.content.findName('MediaPlayer'); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_MediaPlayer$1); this._m_MediaPlayer_MediaOpened$1 = this._m_MediaPlayer$1.addEventListener('mediaOpened', Delegate.create(this, this._mediaPlayer_MediaOpened$1)); this._m_MediaPlayer_MarkerReached$1 = this._m_MediaPlayer$1.addEventListener('markerReached', Delegate.create(this, this._mediaPlayer_MarkerReached$1)); this._m_MediaPlayer_CurrentStateChanged$1 = this._m_MediaPlayer$1.addEventListener('currentStateChanged', Delegate.create(this, this._mediaPlayer_CurrentStateChanged$1)); this._m_MediaPlayer_BufferingProgressChanged$1 = this._m_MediaPlayer$1.addEventListener('bufferingProgressChanged', Delegate.create(this, this._mediaPlayer_BufferingProgressChanged$1)); this._m_MediaPlayer_DownloadProgressChanged$1 = this._m_MediaPlayer$1.addEventListener('downloadProgressChanged', Delegate.create(this, this._mediaPlayer_DownloadProgressChanged$1)); this._m_MediaPlayer_MediaFailed$1 = this._m_MediaPlayer$1.addEventListener('mediaFailed', Delegate.create(this, this._mediaPlayer_MediaFailed$1)); this._m_MediaPlayer_MediaEnded$1 = this._m_MediaPlayer$1.addEventListener('mediaEnded', Delegate.create(this, this._mediaPlayer_MediaEnded$1)); this._m_ProgressTimer$1 = this.m_Control.content.findName('ProgressTimer'); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_ProgressTimer$1); this._m_ProgressTimer_Completed$1 = this._m_ProgressTimer$1.addEventListener('completed', Delegate.create(this, this._progressTimer_Completed$1)); this._m_MarkerLeftTimer$1 = this.m_Control.content.findName('MarkerLeftTimer'); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_MarkerLeftTimer$1); this._m_MarkerLeftTimer_Completed$1 = this._m_MarkerLeftTimer$1.addEventListener('completed', Delegate.create(this, this._markerLeftTimer_Completed$1)); this._m_TotalTimeText$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextTime(this.m_Control.content.findName('TotalTimeText')); this._m_CurrentTimeText$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextTime(this.m_Control.content.findName('CurrentTimeText')); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_TotalTimeText$1); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_CurrentTimeText$1); this._m_PlayPauseButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton(this.m_Control.content.findName('PlayPauseButton')); this._m_PlayPauseButton_Click$1 = Delegate.create(this, this._playPauseButton_Click$1); this._m_PlayPauseButton$1.add_click(this._m_PlayPauseButton_Click$1); this._m_StopButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton(this.m_Control.content.findName('StopButton')); this._m_StopButton_Click$1 = Delegate.create(this, this._stopButton_Click$1); this._m_StopButton$1.add_click(this._m_StopButton_Click$1); this._m_NextButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton(this.m_Control.content.findName('NextButton')); this._m_NextButton_Click$1 = Delegate.create(this, this._nextButton_Click$1); this._m_NextButton$1.add_click(this._m_NextButton_Click$1); this._m_PreviousButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton(this.m_Control.content.findName('PreviousButton')); this._m_PreviousButton_Click$1 = Delegate.create(this, this._previousButton_Click$1); this._m_PreviousButton$1.add_click(this._m_PreviousButton_Click$1); this._m_ProgressControl$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress(this.m_Control.content.findName('Timeline')); this._m_ProgressControl$1.set_highlightControlName('TimeSlider_Highlight'); this._m_ProgressControl$1.set_thumbControlName('TimeThumb'); this._m_ProgressControl$1.set_progress(0); this._m_ProgressControl_ProgressChange$1 = Delegate.create(this, this._progressControl_ProgressChange$1); this._m_ProgressControl$1.add_progressChange(this._m_ProgressControl_ProgressChange$1); this._m_DownloadControl$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress(this.m_Control.content.findName('DownloadProgressSlider')); this._m_DownloadControl$1.set_highlightControlName('DownloadProgressSlider_Highlight'); this._m_DownloadControl$1.set_progress(0); this._m_MarkerContainer$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer(this.m_Control.content.findName('Timeline_MarkerContainer')); this._m_MarkerContainer$1.set_zoomOnMarkerConflict(false); this._m_MarkerContainer_UtteranceHighlighted$1 = Delegate.create(this, this._markerContainer_UtteranceHighlighted$1); this._m_MarkerContainer$1.add_utteranceHighlighted(this._m_MarkerContainer_UtteranceHighlighted$1); this._m_MarkerContainer_UtteranceClick$1 = Delegate.create(this, this._markerContainer_UtteranceClick$1); this._m_MarkerContainer$1.add_utteranceClick(this._m_MarkerContainer_UtteranceClick$1); this._m_MarkerContainer$1.set_debugControl(this._m_DebugControl$1); this._m_ExcerptTooltip$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip(this.m_Control.content.findName('Excerpt')); this._m_MuteButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButton(this.m_Control.content.findName('MuteButton')); this._m_MuteButton_Click$1 = Delegate.create(this, this._muteButton_Click$1); this._m_MuteButton$1.add_click(this._m_MuteButton_Click$1); this._m_VolumeDownButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton(this.m_Control.content.findName('VolumeDownButton')); this._m_VolumeDownButton_Click$1 = Delegate.create(this, this._volumeDownButton_Click$1); this._m_VolumeDownButton$1.add_click(this._m_VolumeDownButton_Click$1); this._m_VolumeUpButton$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton(this.m_Control.content.findName('VolumeUpButton')); this._m_VolumeUpButton_Click$1 = Delegate.create(this, this._volumeUpButton_Click$1); this._m_VolumeUpButton$1.add_click(this._m_VolumeUpButton_Click$1); this._m_VolumeControl$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress(this.m_Control.content.findName('VolumeSliderHook')); this._m_VolumeControl$1.set_thumbControlName('VolumeThumb'); this._m_VolumeControl_ProgressChange$1 = Delegate.create(this, this._volumeControl_ProgressChange$1); this._m_VolumeControl$1.add_progressChange(this._m_VolumeControl_ProgressChange$1); this._m_ConceptsControl$1.beginUpdate(); try { var $enum1 = this._m_Concepts$1.getEnumerator(); while ($enum1.moveNext()) { var concept = $enum1.get_current(); var entry = this._m_ConceptsControl$1.addSeparatorTextEntry(concept, null, concept === this.m_SelectedConcept); if (concept === this.m_SelectedConcept) { this._m_LastSelectedConcept$1 = entry; } } } finally { this._m_ConceptsControl$1.endUpdate(); } if (this.m_AudioFileOnly) { this._m_AudioVisualAnimationFadeIn$1 = this.m_Control.content.findName('AudioVisualAnimationFadeIn'); this._m_AudioVisualAnimationFadeOut$1 = this.m_Control.content.findName('AudioVisualAnimationFadeOut'); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_AudioVisualAnimationFadeIn$1); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_AudioVisualAnimationFadeOut$1); this._m_AudioVisualFadeIn_Completed$1 = this._m_AudioVisualAnimationFadeIn$1.addEventListener('completed', Delegate.create(this, this._audioVisualFadeIn_Completed$1)); this._m_AudioVisualFadeOut_Completed$1 = this._m_AudioVisualAnimationFadeOut$1.addEventListener('completed', Delegate.create(this, this._audioVisualFadeOut_Completed$1)); (this.m_Control.content.findName('AudioVisual')).visibility = 'visible'; this._m_PlayerControls$1.opacity = 1; } this._m_MediaPlayer$1.source = this.m_MediaUri; this._m_Loaded$1 = true; this._resize$1(); }, control_FullScreenChange: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$control_FullScreenChange(p_Sender, p_Args) { /// /// /// /// this._resize$1(); }, control_Resize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$control_Resize(p_Sender, p_Args) { /// /// /// /// this._resize$1(); }, changeConcept: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$changeConcept(p_Concept, p_Callback) { /// /// Placeholder for the server call that fetches the concepts/utterances. /// /// /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.fail(); }, _feedMarkersUtterances$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_feedMarkersUtterances$1() { /// /// Fills the markers on the timeline and the utterance text section with /// the content of the m_Utterances array. /// this._m_LastHighlightUtterance$1 = null; this._m_LastSelectedUtterance$1 = null; this._m_UtteranceContainer$1.clear(); this._m_MarkerContainer$1.clear(); this._m_MediaPlayer$1.markers.clear(); this._m_UtteranceContainer$1.beginUpdate(); try { for (var i = 0; i <= this._m_Utterances$1.length - 1; i++) { var utterance = this._m_Utterances$1[i]; var datetime = new Date(0, 0, 0, 0, 0, Math.truncate(utterance.get_start())); var xaml = ''; var newMarker = this.m_Control.content.createFromXaml(xaml); this._m_MediaPlayer$1.markers.add(newMarker); this._m_MarkerContainer$1.addNewTimeLineMarker(utterance); utterance.set_data(this._m_UtteranceContainer$1.addUtteranceTextEntry(utterance.get_excerpt(), utterance, false)); } } finally { this._m_UtteranceContainer$1.endUpdate(); } this._m_ScrollArea$1.set_scrollTop(0); }, _resize$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_resize$1() { /// /// Adjusts the controls correctly after a resize or a fullscreen operation. /// var m_FullScreenScale = this.m_Control.content.findName('FullScreenScale'); var m_ControlsFullScreenScale = this.m_Control.content.findName('ControlsFullScreenScale'); var controlScale = 1; this._m_UtterancesCanvas$1.width = Math.min(360, this.m_Control.content.actualWidth / 2); this._m_UtterancesCanvas$1.setValue('Canvas.Left', this.m_Control.content.actualWidth - this._m_UtterancesCanvas$1.width); this._m_UtterancesCanvas$1.height = this.m_Control.content.actualHeight; var uttRect = this.m_Control.content.findName('UtterancesRect'); uttRect.height = this.m_Control.content.actualHeight; uttRect.width = this._m_UtterancesCanvas$1.width; var conceptArea = this.m_Control.content.findName('ConceptsArea'); conceptArea.width = this._m_UtterancesCanvas$1.width; var conceptRect = this.m_Control.content.findName('ConceptsAreaRect'); conceptRect.width = conceptArea.width - (conceptRect.getValue('Canvas.Left') * 2); var xaml = ''; var clip = this.m_Control.content.createFromXaml(xaml); conceptArea.clip = clip; this._m_ConceptsControl$1.set_width(this._m_UtterancesCanvas$1.width - (this._m_ConceptsControl$1.get_left() * 2)); var rectTop = conceptRect.getValue('Canvas.Top'); if (this._m_ConceptsControl$1.get_height() < conceptRect.height + 4) { this._m_ConceptsControl$1.set_top(rectTop + (((conceptRect.height + 4) - this._m_ConceptsControl$1.get_height()) / 2)); } else { this._m_ConceptsControl$1.set_top(rectTop + 2); } this._m_ScrollArea$1.set_height(this.m_Control.content.actualHeight - conceptArea.height - 10); this._m_ScrollArea$1.set_width(this._m_UtterancesCanvas$1.width); this._m_UtteranceContainer$1.set_width((this.m_Control.content.findName('UtterancesScrollBar')).getValue('Canvas.Left') - (this._m_UtteranceContainer$1.get_left() * 2)); if (this._m_LastSelectedUtterance$1 != null) { this._m_ScrollArea$1.set_scrollTop(this._m_LastSelectedUtterance$1.get_top()); } else { this._m_ScrollArea$1.set_scrollTop(0); } if (this.m_PlayerHeight !== 480 || this.m_PlayerWidth !== 1005 || this.m_Control.content.fullScreen) { (m_FullScreenScale).scaleX = (this.m_Control.content.actualWidth - this._m_UtterancesCanvas$1.width) / 640; (m_FullScreenScale).scaleY = this.m_Control.content.actualHeight / 480; if (this._m_PlayerControls$1.width <= (this._m_MediaPlayer$1.width * (m_FullScreenScale).scaleX)) { (m_ControlsFullScreenScale).scaleX = 1; (m_ControlsFullScreenScale).scaleY = 1; } else { controlScale = (this._m_MediaPlayer$1.width * (m_FullScreenScale).scaleX) / this._m_PlayerControls$1.width; (m_ControlsFullScreenScale).scaleX = controlScale; (m_ControlsFullScreenScale).scaleY = controlScale; } } else { (m_FullScreenScale).scaleX = 1; (m_FullScreenScale).scaleY = 1; (m_ControlsFullScreenScale).scaleX = 1; (m_ControlsFullScreenScale).scaleY = 1; } this._m_PlayerControls$1.setValue('Canvas.Left', ((this._m_MediaPlayer$1.width * (m_FullScreenScale).scaleX) - (this._m_PlayerControls$1.width * controlScale)) / 2); this._m_PlayerControls$1.setValue('Canvas.Top', this._m_MediaPlayer$1.getValue('Canvas.Top') + (this._m_MediaPlayer$1.height * (m_FullScreenScale).scaleY) - (this._m_PlayerControls$1.height * controlScale)); this._m_ExcerptTooltip$1.set_left(this._m_MediaPlayer$1.getValue('Canvas.Left') + 5); this._m_ExcerptTooltip$1.set_width((this._m_MediaPlayer$1.width * (m_FullScreenScale).scaleX) - 10); this._m_ExcerptTooltip$1.set_top(this._m_PlayerControls$1.getValue('Canvas.Top') - 60); }, _getMediaNaturalDuration$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_getMediaNaturalDuration$1() { /// /// Returns the value of the NaturalDuration property of the media player. /// This is done in a function to bypass the Script# TimeSpan class limitation. /// /// var result = 0; var naturalDuration = this._m_MediaPlayer$1.getValue('NaturalDuration'); if (naturalDuration != null) { var durationHack = (naturalDuration).getValue('seconds'); result = durationHack; } return result; }, _getMediaPosition$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_getMediaPosition$1() { /// /// Returns the value of the Position property of the media player. This is /// done in a function to bypass the Script# TimeSpan class limitation. /// /// var position = this._m_MediaPlayer$1.getValue('Position'); var positionHack = (position).getValue('seconds'); return positionHack; }, _changeMediaPlayerPosition$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_changeMediaPlayerPosition$1(p_newTime) { /// /// Use this function to set the value of the media player Position property. /// /// /// New position in seconds. /// if (p_newTime <= this._getMediaNaturalDuration$1()) { var newTimeHack = this._m_MediaPlayer$1.getValue('Position'); (newTimeHack).setValue('seconds', p_newTime); this._m_MediaPlayer$1.setValue('Position', newTimeHack); } }, _getCurrentUtteranceIndex$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_getCurrentUtteranceIndex$1(p_IncludeHeadStartTolerance) { /// /// Returns the index according to the /// current position of the media player. /// /// /// Set this value to True to include the head start value as part of the Utterance. /// /// var seconds = this._getMediaPosition$1(); if (p_IncludeHeadStartTolerance) { seconds = Math.min(seconds + this.m_HeadStart, this.m_MediaLength); } var result = -1; for (var i = 0; i <= this._m_Utterances$1.length - 1; i++) { var utterance = this._m_Utterances$1[i]; if (utterance.get_start() < seconds) { result = i; } else { break; } } return result; }, _getCurrentUtterance$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_getCurrentUtterance$1() { /// /// Returns the object according to the /// current position of the media player. /// /// var result = null; var index = this._getCurrentUtteranceIndex$1(false); if (index > -1) { result = this._m_Utterances$1[index]; } return result; }, _handleMarkerReached$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_handleMarkerReached$1(p_Utterance) { /// /// Synchronize the utterances Div section with the media player position. /// /// /// The utterance to sync with. This value can be null. /// if (this._m_LastSelectedUtterance$1 != null) { this._m_LastSelectedUtterance$1.set_selected(false); this._m_LastSelectedUtterance$1 = null; } if (p_Utterance != null) { var text = p_Utterance.get_data(); text.set_selected(true); this._m_ScrollArea$1.scrollTo(text.get_top(), text.get_height()); this._m_LastSelectedUtterance$1 = text; } else { this._m_ScrollArea$1.set_scrollTop(0); } }, _handleUtteranceClick$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_handleUtteranceClick$1(p_Utterance) { /// /// This method is called whenever (and wherever) a utterance was clicked. /// /// /// The current utterance. This value can be null. /// this._m_UtterancesDirty$1 = true; if (p_Utterance != null) { this._m_ProgressControl$1.set_progress(Math.max(0, p_Utterance.get_percent() - this._m_HeadStartAsPercent$1)); } this._handleMarkerReached$1(p_Utterance); }, _mediaPlayer_CurrentStateChanged$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_mediaPlayer_CurrentStateChanged$1(p_Sender, p_Args) { /// /// /// /// if (this._m_MediaPlayer$1.currentState === 'playing') { this._m_ProgressTimer$1.begin(); this._m_PlayPauseButton$1.set_mode(Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode.pause); if (this.m_AudioFileOnly) { this._m_AudioVisualAnimationFadeIn$1.begin(); } } else { this._m_ProgressTimer$1.stop(); if (this.m_AudioFileOnly) { this._m_AudioVisualAnimationFadeIn$1.stop(); this._m_AudioVisualAnimationFadeOut$1.stop(); } this._m_PlayPauseButton$1.set_mode(Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode.play); if (this._m_MediaPlayer$1.currentState === 'stopped') { this._m_ProgressControl$1.updateProgress(0); this._m_CurrentTimeText$1.set_seconds(0); this._handleMarkerReached$1(null); } } }, _mediaPlayer_BufferingProgressChanged$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_mediaPlayer_BufferingProgressChanged$1(p_Sender, p_Args) { /// /// /// /// if (!this._m_UtterancesDirty$1 && (this._m_Utterances$1.length > 0)) { } }, _mediaPlayer_DownloadProgressChanged$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_mediaPlayer_DownloadProgressChanged$1(p_Sender, p_Args) { /// /// /// /// this._m_DownloadControl$1.set_progress(this._m_MediaPlayer$1.downloadProgress); if (!this._m_UtterancesDirty$1 && (this._m_Utterances$1.length > 0) && (((this._m_Utterances$1[0]).get_percent() * 1.05) < this._m_MediaPlayer$1.downloadProgress)) { } }, _mediaPlayer_MediaFailed$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_mediaPlayer_MediaFailed$1(p_Sender, p_Args) { /// /// /// /// alert(Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayerControl.unablE_TO_PLAY_ERROR); }, _mediaPlayer_MediaOpened$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_mediaPlayer_MediaOpened$1(p_Sender, p_Args) { /// /// /// /// var totalSeconds = this.m_MediaLength; this._m_TotalTimeText$1.set_seconds(totalSeconds); this._m_HeadStartAsPercent$1 = 0; if (totalSeconds > 0) { this._m_HeadStartAsPercent$1 = this.m_HeadStart / totalSeconds; } this._m_VolumeControl$1.set_progress(this._m_MediaPlayer$1.volume); this._feedMarkersUtterances$1(); if (this.m_AudioFileOnly && (this._m_MediaPlayer$1.naturalVideoHeight > 0 || this._m_MediaPlayer$1.naturalVideoWidth > 0)) { (this.m_Control.content.findName('AudioVisual')).visibility = 'collapsed'; Coveo.CNL.Web.Scripts.CNLAssert.failWithMessage('Video file was converted as an audio file.'); } this._m_MediaPlayer$1.play(); }, _mediaPlayer_MediaEnded$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_mediaPlayer_MediaEnded$1(p_Sender, p_Args) { /// /// /// /// this._m_MediaPlayer$1.stop(); }, _mediaPlayer_MarkerReached$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_mediaPlayer_MarkerReached$1(p_Sender, p_Args) { /// /// /// /// var marker = p_Args.marker.text; this._handleMarkerReached$1(this._m_Utterances$1[marker]); }, _audioVisualFadeIn_Completed$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_audioVisualFadeIn_Completed$1(p_Sender, p_Args) { /// /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.check(this.m_AudioFileOnly); if (this._m_MediaPlayer$1.currentState === 'playing') { this._m_AudioVisualAnimationFadeOut$1.begin(); } }, _audioVisualFadeOut_Completed$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_audioVisualFadeOut_Completed$1(p_Sender, p_Args) { /// /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.check(this.m_AudioFileOnly); if (this._m_MediaPlayer$1.currentState === 'playing') { this._m_AudioVisualAnimationFadeIn$1.begin(); } }, _progressTimer_Completed$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_progressTimer_Completed$1(p_Sender, p_Args) { /// /// /// /// if (this._m_MediaPlayer$1.currentState === 'playing') { var seconds = this._getMediaPosition$1(); this._m_ProgressControl$1.updateProgress(seconds / this.m_MediaLength); this._m_CurrentTimeText$1.set_seconds(seconds); this._m_ProgressTimer$1.begin(); } }, _fullScreenHook_DoubleClick$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_fullScreenHook_DoubleClick$1(sender, e) { /// /// /// /// this.m_Control.content.fullScreen = !this.m_Control.content.fullScreen; }, _fullScreenButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_fullScreenButton_Click$1(p_Sender, p_Args) { /// /// /// /// this.m_Control.content.fullScreen = !this.m_Control.content.fullScreen; }, _markersZoom_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_markersZoom_Click$1(p_Sender, p_Args) { /// /// /// /// this._m_MarkerContainer$1.set_zoomOnMarkerConflict(!this._m_MarkerContainer$1.get_zoomOnMarkerConflict()); if (this._m_MarkerContainer$1.get_zoomOnMarkerConflict()) { this._m_MarkersZoomButton$1.set_state(Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState.enabled); } else { this._m_MarkersZoomButton$1.set_state(Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState.grayed); } }, _volumeControl_ProgressChange$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_volumeControl_ProgressChange$1(p_Sender, p_Args) { /// /// /// /// this._m_MediaPlayer$1.volume = (p_Sender).get_progress(); }, _volumeUpButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_volumeUpButton_Click$1(p_Sender, p_Args) { /// /// /// /// var newVolume = this._m_MediaPlayer$1.volume + 0.05; this._m_VolumeControl$1.set_progress(Math.min(newVolume, 1)); }, _volumeDownButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_volumeDownButton_Click$1(p_Sender, p_Args) { /// /// /// /// var newVolume = this._m_MediaPlayer$1.volume - 0.05; this._m_VolumeControl$1.set_progress(Math.max(newVolume, 0)); }, _muteButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_muteButton_Click$1(p_Sender, p_Args) { /// /// /// /// if (this._m_MediaPlayer$1.isMuted) { this._m_MediaPlayer$1.isMuted = false; (this.m_Control.content.findName('MuteOffSymbol')).opacity = 1; } else { this._m_MediaPlayer$1.isMuted = true; (this.m_Control.content.findName('MuteOffSymbol')).opacity = 0; } }, _progressControl_ProgressChange$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_progressControl_ProgressChange$1(p_Sender, p_Args) { /// /// /// /// var newTime = (p_Sender).get_progress() * this.m_MediaLength; this._changeMediaPlayerPosition$1(newTime); this._handleMarkerReached$1(this._getCurrentUtterance$1()); }, _previousButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_previousButton_Click$1(p_Sender, p_Args) { /// /// /// /// if (this._m_MediaPlayer$1.currentState === 'buffering') { return; } var currentIndex = this._getCurrentUtteranceIndex$1(true); if (currentIndex >= 1) { this._handleUtteranceClick$1(this._m_Utterances$1[currentIndex - 1]); } }, _nextButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_nextButton_Click$1(p_Sender, p_Args) { /// /// /// /// if (this._m_MediaPlayer$1.currentState === 'buffering') { return; } var currentIndex = this._getCurrentUtteranceIndex$1(true); if (currentIndex < this._m_Utterances$1.length - 1) { this._handleUtteranceClick$1(this._m_Utterances$1[currentIndex + 1]); } }, _stopButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_stopButton_Click$1(p_Sender, p_Args) { /// /// /// /// if ((this._m_MediaPlayer$1.currentState === 'playing') || (this._m_MediaPlayer$1.currentState === 'paused') || (this._m_MediaPlayer$1.currentState === 'buffering')) { this._m_MediaPlayer$1.stop(); } }, _playPauseButton_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_playPauseButton_Click$1(p_Sender, p_Args) { /// /// /// /// if (this._m_MediaPlayer$1.currentState === 'playing') { this._m_MediaPlayer$1.pause(); } else { this._m_MediaPlayer$1.play(); } }, _playerControls_MouseEnter$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_playerControls_MouseEnter$1(p_Sender, p_Args) { /// /// /// /// if (!this.m_AudioFileOnly) { this._m_PlayerControlsFadeInAnimation$1.begin(); } }, _playerControls_MouseLeave$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_playerControls_MouseLeave$1(p_Sender, p_Args) { /// /// /// /// if (!this.m_AudioFileOnly) { this._m_PlayerControlsFadeOutInAnimation$1.begin(); } }, _conceptsControl_TextEntryClick$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_conceptsControl_TextEntryClick$1(p_Sender, p_Args) { /// /// /// /// this.m_SearchTextBox.setAttribute('value', p_Args.textEntry.get_text()); if (this._m_LastSelectedConcept$1 != null) { this._m_LastSelectedConcept$1.set_selected(false); } p_Args.textEntry.set_selected(true); this._m_LastSelectedConcept$1 = p_Args.textEntry; this.changeConcept(p_Args.textEntry.get_text(), Delegate.create(this, this._conceptChanged$1)); }, _conceptChanged$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_conceptChanged$1(p_ReturnValue) { /// /// Handles the return value of the ChangeConcept method. /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_ReturnValue); this._m_Utterances$1.clear(); var xml = p_ReturnValue; var nodes = xml.selectSingleNode('Utterances').childNodes; for (var i = 0; i < nodes.length; i++) { var node = nodes[i]; this.addUtterance(Number.parse((node.attributes.getNamedItem('Start')).value), Number.parse((node.attributes.getNamedItem('Percent')).value), (node.attributes.getNamedItem('Excerpt')).value); } this._feedMarkersUtterances$1(); }, _utteranceContainer_UtteranceClick$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_utteranceContainer_UtteranceClick$1(p_Sender, p_Args) { /// /// /// /// this._handleUtteranceClick$1(p_Args.textEntry.get_data()); }, _markerLeftTimer_Completed$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_markerLeftTimer_Completed$1(p_Sender, p_Args) { /// /// /// /// if (this._m_LastSelectedUtterance$1 != null) { this._m_ScrollArea$1.scrollTo(this._m_LastSelectedUtterance$1.get_top(), this._m_LastSelectedUtterance$1.get_height()); } }, _markerContainer_UtteranceClick$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_markerContainer_UtteranceClick$1(p_Sender, p_Args) { /// /// /// /// this._handleUtteranceClick$1(p_Args); }, _markerContainer_UtteranceHighlighted$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayerControl$_markerContainer_UtteranceHighlighted$1(p_Sender, p_Args) { /// /// /// /// this._m_MarkerLeftTimer$1.stop(); if (p_Args != null) { var text = p_Args.get_data(); this._m_ScrollArea$1.scrollTo(text.get_top(), text.get_height()); text.highlight(); this._m_LastHighlightUtterance$1 = text; this._m_ExcerptTooltip$1.set_text(p_Args.get_excerpt()); this._m_ExcerptTooltip$1.set_visible(true); } else { if (this._m_LastSelectedUtterance$1 != null) { this._m_MarkerLeftTimer$1.begin(); } if (this._m_LastHighlightUtterance$1 != null) { this._m_LastHighlightUtterance$1.undoHighlight(); this._m_LastHighlightUtterance$1 = null; } this._m_ExcerptTooltip$1.set_visible(false); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayPauseButton(p_TargetControl) { /// /// Class used to manipulated a media play/pause button. /// /// /// /// /// /// /// /// /// this._m_Mode$3 = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode.play; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton.constructBase(this, [ p_TargetControl ]); } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton.prototype = { _m_PlaySymbol$3: null, _m_PauseSymbol$3: null, get_mode: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayPauseButton$get_mode() { /// /// Gets or sets the button mode. /// /// return this._m_Mode$3; }, set_mode: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayPauseButton$set_mode(value) { /// /// Gets or sets the button mode. /// /// this._m_Mode$3 = value; this.renderControl(); return value; }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayPauseButton$tearDown() { this._m_PlaySymbol$3 = null; this._m_PauseSymbol$3 = null; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton.callBase(this, 'tearDown'); }, initialize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayPauseButton$initialize() { Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton.callBase(this, 'initialize'); this._m_PlaySymbol$3 = this.m_TargetControl.findName('PlaySymbol'); this._m_PauseSymbol$3 = this.m_TargetControl.findName('PauseSymbol'); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_PlaySymbol$3); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_PauseSymbol$3); }, renderControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightPlayPauseButton$renderControl() { Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton.callBase(this, 'renderControl'); if (this._m_Mode$3 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode.play) { this._m_PlaySymbol$3.opacity = 1; this._m_PauseSymbol$3.opacity = 0; } else if (this._m_Mode$3 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButtonMode.pause) { this._m_PlaySymbol$3.opacity = 0; this._m_PauseSymbol$3.opacity = 1; } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress(p_TargetControl) { /// /// Base class for controls rendering progression values. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// this._m_Orientation$1 = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation.horizontal; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress.constructBase(this, [ p_TargetControl ]); } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress.prototype = { _m_ThumbControlName$1: null, _m_HighlightControlName$1: null, _m_ProgressWhileDraggingThumb$1: false, _m_Progress$1: 0, _m_Thumb$1: null, _m_Highlight$1: null, _m_Thumb_Dragging$1: null, _m_Thumb_DragDrop$1: null, add_progressChange: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$add_progressChange(value) { /// /// Event fired when the progression is changed. /// /// this.__progressChange$1 = Delegate.combine(this.__progressChange$1, value); }, remove_progressChange: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$remove_progressChange(value) { /// /// Event fired when the progression is changed. /// /// this.__progressChange$1 = Delegate.remove(this.__progressChange$1, value); }, __progressChange$1: null, get_thumbControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$get_thumbControlName() { /// /// Gets or sets the Xaml name of the control representing the thumb element. /// /// return this._m_ThumbControlName$1; }, set_thumbControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$set_thumbControlName(value) { /// /// Gets or sets the Xaml name of the control representing the thumb element. /// /// this._m_ThumbControlName$1 = value; this._m_Thumb$1 = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton(this.m_TargetControl.findName(this._m_ThumbControlName$1)); this._m_Thumb_Dragging$1 = Delegate.create(this, this._thumb_Dragging$1); this._m_Thumb$1.add_dragging(this._m_Thumb_Dragging$1); this._m_Thumb_DragDrop$1 = Delegate.create(this, this._thumb_DragDrop$1); this._m_Thumb$1.add_dragDrop(this._m_Thumb_DragDrop$1); return value; }, get_highlightControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$get_highlightControlName() { /// /// Gets or sets the Xaml name of the control representing the highlight element. /// /// return this._m_HighlightControlName$1; }, set_highlightControlName: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$set_highlightControlName(value) { /// /// Gets or sets the Xaml name of the control representing the highlight element. /// /// this._m_HighlightControlName$1 = value; this._m_Highlight$1 = this.m_TargetControl.findName(this._m_HighlightControlName$1); return value; }, get_orientation: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$get_orientation() { /// /// Gets or sets the orientation of the control. /// /// return this._m_Orientation$1; }, set_orientation: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$set_orientation(value) { /// /// Gets or sets the orientation of the control. /// /// this._m_Orientation$1 = value; return value; }, get_progressWhileDraggingThumb: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$get_progressWhileDraggingThumb() { /// /// Gets or sets the flag indicating that the control will update its Progress value /// on a drag operation. /// If this value is False, the Progress value will be change only when a /// drag drop operation will terminate (mouse release). Otherwise, the progress value will be /// updated everytime the mouse moves within a drag operation. /// /// return this._m_ProgressWhileDraggingThumb$1; }, set_progressWhileDraggingThumb: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$set_progressWhileDraggingThumb(value) { /// /// Gets or sets the flag indicating that the control will update its Progress value /// on a drag operation. /// If this value is False, the Progress value will be change only when a /// drag drop operation will terminate (mouse release). Otherwise, the progress value will be /// updated everytime the mouse moves within a drag operation. /// /// this._m_ProgressWhileDraggingThumb$1 = value; return value; }, get_progress: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$get_progress() { /// /// Gets or sets the current control progression. The progression is /// represented on a linear scale between 0 and 1. Setting the Progress /// property fires the event. /// /// return this._m_Progress$1; }, set_progress: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$set_progress(value) { /// /// Gets or sets the current control progression. The progression is /// represented on a linear scale between 0 and 1. Setting the Progress /// property fires the event. /// /// this._setProgress$1(value, true); return value; }, updateProgress: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$updateProgress(p_Progress) { /// /// Call UpdateProgress if you want to change the Progress value and don't /// want to receive a event. /// /// /// Progress value between 0 and 1. /// Coveo.CNL.Web.Scripts.CNLAssert.check(p_Progress >= 0 && p_Progress <= 1); this._setProgress$1(p_Progress, false); }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$tearDown() { if (this._m_Thumb$1 != null) { this._m_Thumb$1.remove_dragging(this._m_Thumb_Dragging$1); this._m_Thumb$1.remove_dragDrop(this._m_Thumb_DragDrop$1); } this._m_Thumb$1 = null; this._m_Highlight$1 = null; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress.callBase(this, 'tearDown'); }, getProgressFromMousePos: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$getProgressFromMousePos(p_MousePos) { /// /// Returns the progression corresponding to mouse coords. /// /// /// Mouse event arguments. /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_MousePos); if (this._m_Orientation$1 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation.horizontal) { return Math.min(Math.max(0, p_MousePos.getPosition(this.m_TargetControl).x / this.m_TargetControl.width), 1); } else { return Math.min(Math.max(0, p_MousePos.getPosition(this.m_TargetControl).y / this.m_TargetControl.height), 1); } }, renderControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$renderControl() { Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress.callBase(this, 'renderControl'); if (this._m_Thumb$1 != null) { if (this._m_Orientation$1 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation.horizontal) { this._m_Thumb$1.set_left(Math.min(Math.max(0, (this.get_progress() * this.m_TargetControl.width) - (this._m_Thumb$1.get_width() / 2)), this.m_TargetControl.width - this._m_Thumb$1.get_width())); } else { this._m_Thumb$1.set_top(Math.min(Math.max(0, (this.get_progress() * this.m_TargetControl.height) - (this._m_Thumb$1.get_height() / 2)), this.m_TargetControl.height - this._m_Thumb$1.get_height())); } } if (this._m_Highlight$1 != null) { if (this._m_Orientation$1 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation.horizontal) { this._m_Highlight$1.width = this.get_progress() * this.m_TargetControl.width; } else { this._m_Highlight$1.height = this.get_progress() * this.m_TargetControl.height; } } }, onDragging: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$onDragging(p_Args) { /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Args); if (this._m_ProgressWhileDraggingThumb$1) { this.set_progress(this.getProgressFromMousePos(p_Args)); } this.onProgressDragging(this.getProgressFromMousePos(p_Args)); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress.callBase(this, 'onDragging', [ p_Args ]); }, onProgressDragging: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$onProgressDragging(p_Progress) { /// /// }, onClick: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$onClick(p_Args) { /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Args); this.set_progress(this.getProgressFromMousePos(p_Args)); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress.callBase(this, 'onClick', [ p_Args ]); }, onDragDrop: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$onDragDrop(p_Args) { /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Args); this.set_progress(this.getProgressFromMousePos(p_Args)); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress.callBase(this, 'onDragDrop', [ p_Args ]); }, _setProgress$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$_setProgress$1(p_Progress, p_TriggerChange) { /// /// Sets progression. /// /// /// Progression value. /// /// /// Flag indicating to trigger the event. /// Coveo.CNL.Web.Scripts.CNLAssert.check(p_Progress >= 0 && p_Progress <= 1); this._m_Progress$1 = p_Progress; if (!this.get_isDragging()) { this.renderControl(); } if (p_TriggerChange && (this.__progressChange$1 != null)) { this.__progressChange$1.invoke(this, new EventArgs()); } }, _thumb_DragDrop$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$_thumb_DragDrop$1(p_Sender, p_Args) { /// /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Args); this.set_progress(this.getProgressFromMousePos(p_Args)); }, _thumb_Dragging$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightProgress$_thumb_Dragging$1(p_Sender, p_Args) { /// /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_Thumb$1); if (this._m_Orientation$1 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation.horizontal) { this._m_Thumb$1.set_left(Math.min(Math.max(0, (this.getProgressFromMousePos(p_Args) * this.m_TargetControl.width) - (this._m_Thumb$1.get_width() / 2)), this.m_TargetControl.width - this._m_Thumb$1.get_width())); } else { this._m_Thumb$1.set_top(Math.min(Math.max(0, (this.getProgressFromMousePos(p_Args) * this.m_TargetControl.height) - (this._m_Thumb$1.get_height() / 2)), this.m_TargetControl.height - this._m_Thumb$1.get_height())); } if (this._m_Highlight$1 != null) { if (this._m_Orientation$1 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgressOrientation.horizontal) { this._m_Highlight$1.width = this.getProgressFromMousePos(p_Args) * this.m_TargetControl.width; } else { this._m_Highlight$1.height = this.getProgressFromMousePos(p_Args) * this.m_TargetControl.height; } } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightSymbolButton(p_TargetCanvas) { /// /// Represents a button containing a symbol. The symbol is used to represent /// the different button states. /// /// /// /// /// /// /// /// /// /// /// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton.constructBase(this, [ p_TargetCanvas ]); } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton.prototype = { _m_EnabledSymbol$2: null, _m_DisabledSymbol$2: null, _m_GrayedSymbol$2: null, _m_State$2: 0, get_state: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightSymbolButton$get_state() { /// /// Gets or sets the button current state. /// /// return this._m_State$2; }, set_state: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightSymbolButton$set_state(value) { /// /// Gets or sets the button current state. /// /// this._m_State$2 = value; this.renderControl(); return value; }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightSymbolButton$tearDown() { this._m_EnabledSymbol$2 = null; this._m_DisabledSymbol$2 = null; this._m_GrayedSymbol$2 = null; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton.callBase(this, 'tearDown'); }, initialize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightSymbolButton$initialize() { Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton.callBase(this, 'initialize'); this._m_EnabledSymbol$2 = this.m_TargetControl.findName(this.m_TargetControl.name + '_Enabled'); this._m_DisabledSymbol$2 = this.m_TargetControl.findName(this.m_TargetControl.name + '_Disabled'); this._m_GrayedSymbol$2 = this.m_TargetControl.findName(this.m_TargetControl.name + '_Grayed'); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_EnabledSymbol$2); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_DisabledSymbol$2); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_GrayedSymbol$2); }, renderControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightSymbolButton$renderControl() { Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton.callBase(this, 'renderControl'); this._m_EnabledSymbol$2.opacity = 0; this._m_DisabledSymbol$2.opacity = 0; this._m_GrayedSymbol$2.opacity = 0; if (this._m_State$2 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState.disabled) { this._m_DisabledSymbol$2.opacity = 1; } else if (this._m_State$2 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState.enabled) { this._m_EnabledSymbol$2.opacity = 1; } else if (this._m_State$2 === Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButtonState.grayed) { this._m_GrayedSymbol$2.opacity = 1; } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextTime Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextTime = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextTime(p_Target) { /// /// Class used to render a time value. /// /// /// /// /// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextTime.constructBase(this, [ p_Target ]); } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextTime.prototype = { _m_Seconds$1: 0, get_seconds: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextTime$get_seconds() { /// /// Gets or sets the time (in seconds) to display. /// /// return this._m_Seconds$1; }, set_seconds: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextTime$set_seconds(value) { /// /// Gets or sets the time (in seconds) to display. /// /// this._m_Seconds$1 = value; this.renderControl(); return value; }, renderControl: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTextTime$renderControl() { Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextTime.callBase(this, 'renderControl'); var datetime = new Date(0, 0, 0, 0, 0, Math.truncate(this._m_Seconds$1)); var hours = datetime.getHours(); var minutes = datetime.getMinutes() + (hours * 60); (this.m_TargetControl).text = minutes.toString().padLeft(2, '0') + ':' + datetime.getSeconds().toString().padLeft(2, '0'); } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarker(p_TargetControl) { /// /// Class used to render markers on the timeline of the media player. /// /// /// /// /// /// /// /// /// Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker.constructBase(this, [ p_TargetControl ]); } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker.prototype = { _m_Utterance$1: null, get_utterance: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarker$get_utterance() { /// /// Gets or sets the represented by the /// current marker. /// /// return this._m_Utterance$1; }, set_utterance: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarker$set_utterance(value) { /// /// Gets or sets the represented by the /// current marker. /// /// this._m_Utterance$1 = value; return value; }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarker$tearDown() { this._m_Utterance$1 = null; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker.callBase(this, 'tearDown'); }, initialize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarker$initialize() { Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker.callBase(this, 'initialize'); }, onMouseMove: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarker$onMouseMove(p_Args) { /// /// ((this.m_TargetControl).fill).color = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker._mousE_ENTER_COLOR$1; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker.callBase(this, 'onMouseMove', [ p_Args ]); }, onMouseLeave: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarker$onMouseLeave(p_Args) { /// /// ((this.m_TargetControl).fill).color = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker._mousE_LEAVE_COLOR$1; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker.callBase(this, 'onMouseLeave', [ p_Args ]); } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer(p_TargetControl) { /// /// This control contains and displays media markers along a timeline. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// this._m_Markers$1 = []; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer.constructBase(this, [ p_TargetControl ]); } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer.prototype = { _m_ZoomOnMarkerConflict$1: false, _m_CanZoom$1: true, _m_DelayResetZoom$1: false, _m_MarkerConflictContainer$1: null, _m_ConflictFocusInAnimation$1: null, _m_ConflictScaleAnimation$1: null, _m_ContainerAnimation$1: null, _m_ContainerDoubleAnimation$1: null, _m_ConflictFocusOutTimer$1: null, _m_ScaleFactor$1: 1, _m_BaseWidth$1: 0, _m_BaseLeft$1: 0, _m_LastCursorPos$1: null, _m_LastZoomStartPos$1: null, _m_MarkerConflictContainerMouseLeave$1: null, _m_ConflictFocusOut_Completed$1: null, _m_ContainerAnimation_Completed$1: null, add_utteranceHighlighted: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$add_utteranceHighlighted(value) { /// /// Event fired when an utterance is highlighted. /// /// this.__utteranceHighlighted$1 = Delegate.combine(this.__utteranceHighlighted$1, value); }, remove_utteranceHighlighted: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$remove_utteranceHighlighted(value) { /// /// Event fired when an utterance is highlighted. /// /// this.__utteranceHighlighted$1 = Delegate.remove(this.__utteranceHighlighted$1, value); }, __utteranceHighlighted$1: null, add_utteranceClick: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$add_utteranceClick(value) { /// /// Event fired when an utterance is clicked. /// /// this.__utteranceClick$1 = Delegate.combine(this.__utteranceClick$1, value); }, remove_utteranceClick: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$remove_utteranceClick(value) { /// /// Event fired when an utterance is clicked. /// /// this.__utteranceClick$1 = Delegate.remove(this.__utteranceClick$1, value); }, __utteranceClick$1: null, get_zoomOnMarkerConflict: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$get_zoomOnMarkerConflict() { /// /// Gets or sets the value indicating that the control will show a zoom box /// if there is a visual conflict between utterances. /// /// return this._m_ZoomOnMarkerConflict$1; }, set_zoomOnMarkerConflict: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$set_zoomOnMarkerConflict(value) { /// /// Gets or sets the value indicating that the control will show a zoom box /// if there is a visual conflict between utterances. /// /// this._m_ZoomOnMarkerConflict$1 = value; return value; }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$tearDown() { var $enum1 = this._m_Markers$1.getEnumerator(); while ($enum1.moveNext()) { var marker = $enum1.get_current(); marker.tearDown(); } this._m_MarkerConflictContainer$1.removeEventListener('mouseLeave', this._m_MarkerConflictContainerMouseLeave$1); this._m_ConflictFocusOutTimer$1.removeEventListener('completed', this._m_ConflictFocusOut_Completed$1); this._m_ContainerAnimation$1.removeEventListener('completed', this._m_ContainerAnimation_Completed$1); this._m_Markers$1.clear(); this._m_Markers$1 = null; this._m_MarkerConflictContainer$1 = null; this._m_ConflictFocusInAnimation$1 = null; this._m_ConflictScaleAnimation$1 = null; this._m_ContainerAnimation$1 = null; this._m_ContainerDoubleAnimation$1 = null; this._m_ConflictFocusOutTimer$1 = null; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer.callBase(this, 'tearDown'); }, clear: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$clear() { /// /// Clears the list of markers. /// (this.m_TargetControl).children.clear(); for (var i = (this.m_TargetControl).resources.count - 1; i >= 1; i--) { (this.m_TargetControl).resources.removeAt(i); } var $enum1 = this._m_Markers$1.getEnumerator(); while ($enum1.moveNext()) { var marker = $enum1.get_current(); marker.tearDown(); } this._m_Markers$1.clear(); }, addNewTimeLineMarker: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$addNewTimeLineMarker(p_Utterance) { /// /// Adds a new time line marker to visually indicate the position of an /// utterance. /// /// /// The utterance to mark. /// var index = this._m_Markers$1.length.toString(); var xaml = '' + '' + '' + '' + ''; var newMarker = this.m_TargetControl.getHost().content.createFromXaml(xaml); var markerLeft = Math.min(Math.max(0, (p_Utterance.get_percent() * this.m_TargetControl.width) - (newMarker.width / 2)), this.m_TargetControl.width - newMarker.width); newMarker.setValue('Canvas.Left', markerLeft); (this.m_TargetControl).children.add(newMarker); var marker = new Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker(newMarker); marker.set_utterance(p_Utterance); marker.add_mouseEnter(Delegate.create(this, this._marker_MouseEnter$1)); marker.add_mouseLeave(Delegate.create(this, this._marker_MouseLeave$1)); marker.add_click(Delegate.create(this, this._marker_Click$1)); this._m_Markers$1.add(marker); var zoomXaml = '' + '' + '' + ''; var markerAnimation = this.m_TargetControl.getHost().content.createFromXaml(zoomXaml); (this.m_TargetControl).resources.add(markerAnimation); }, initialize: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$initialize() { Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer.callBase(this, 'initialize'); this._m_BaseWidth$1 = this.get_width(); this._m_BaseLeft$1 = this.get_left(); this._m_MarkerConflictContainer$1 = this.m_TargetControl.getHost().content.findName('Timeline_MarkersConflictContainer'); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_MarkerConflictContainer$1); this._m_MarkerConflictContainerMouseLeave$1 = this._m_MarkerConflictContainer$1.addEventListener('mouseLeave', Delegate.create(this, this._markerConflictContainerMouseLeave$1)); this._m_ConflictFocusInAnimation$1 = this.m_TargetControl.getHost().content.findName('Timeline_MarkersConflictContainer_FocusIn'); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_ConflictFocusInAnimation$1); this._m_ConflictFocusOutTimer$1 = this.m_TargetControl.getHost().content.findName('Timeline_MarkersConflictContainer_FocusOut'); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_ConflictFocusOutTimer$1); this._m_ConflictFocusOut_Completed$1 = this._m_ConflictFocusOutTimer$1.addEventListener('completed', Delegate.create(this, this._conflictFocusOut_Completed$1)); this._m_ConflictScaleAnimation$1 = this.m_TargetControl.getHost().content.findName('Timeline_MarkersConflictContainer_Scale'); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_ConflictScaleAnimation$1); this._m_ContainerAnimation$1 = this.m_TargetControl.getHost().content.findName('Timeline_MarkerContainerAnimation'); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_ContainerAnimation$1); this._m_ContainerAnimation_Completed$1 = this._m_ContainerAnimation$1.addEventListener('completed', Delegate.create(this, this._containerAnimation_Completed$1)); this._m_ContainerDoubleAnimation$1 = this.m_TargetControl.getHost().content.findName('_Timeline_MarkerContainerAnimation'); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_ContainerDoubleAnimation$1); }, onMouseWheel: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$onMouseWheel(p_WheelDelta) { /// /// if (!this._m_ZoomOnMarkerConflict$1 && this._m_LastCursorPos$1 != null) { if (p_WheelDelta < 0) { if (this._m_LastZoomStartPos$1 != null) { this._displayConflictRect$1(this._m_LastZoomStartPos$1, Coveo.CES.Web.Search.Scripts.Controls.Results.ZoomDirection.zoomOut); } } else { if (this._m_LastZoomStartPos$1 == null) { this._m_LastZoomStartPos$1 = this._m_LastCursorPos$1; } this._displayConflictRect$1(this._m_LastZoomStartPos$1, Coveo.CES.Web.Search.Scripts.Controls.Results.ZoomDirection.zoomIn); } } }, onMouseMove: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$onMouseMove(p_Args) { /// /// this._m_LastCursorPos$1 = p_Args.getPosition(this.m_TargetControl); }, onMouseLeave: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$onMouseLeave(p_Args) { /// /// this._m_ScaleFactor$1 = 1; if (this._m_CanZoom$1) { this._renderFromScale$1(null); } else { this._m_DelayResetZoom$1 = true; } }, _displayConflictRect$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$_displayConflictRect$1(p_Point, p_Direction) { /// /// Renders the markers on a different scale when a conflict is detected. /// /// /// The actual mouse position. /// /// /// The value. /// if (!this._m_CanZoom$1) { return; } Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Point); if (p_Direction === Coveo.CES.Web.Search.Scripts.Controls.Results.ZoomDirection.zoomIn) { this._m_ScaleFactor$1 = this._m_ScaleFactor$1 + 1; this._renderFromScale$1(p_Point); } else { this._m_ScaleFactor$1 = Math.max(1, this._m_ScaleFactor$1 - 1); if (this._m_ScaleFactor$1 === 1) { this._renderFromScale$1(null); } else { this._renderFromScale$1(p_Point); } } }, _renderFromScale$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$_renderFromScale$1(p_Point) { /// /// Renders the markers according to the current scale. /// /// /// The actual mouse position. This value can be null. /// Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_CanZoom$1); this._m_DelayResetZoom$1 = false; var newLeft = this._m_BaseLeft$1; if (p_Point == null) { Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_ScaleFactor$1 === 1); this.set_width(this._m_BaseWidth$1); this._m_LastZoomStartPos$1 = null; } else { Coveo.CNL.Web.Scripts.CNLAssert.check(p_Point != null); var currentLeft = this.get_left(); var pointRatio = p_Point.x / this.get_width(); this.set_width(this._m_BaseWidth$1 * this._m_ScaleFactor$1); var newPointPos = pointRatio * this.get_width(); var threshhold = newPointPos - p_Point.x; newLeft = currentLeft - threshhold; } this._m_ContainerDoubleAnimation$1.from = this.get_left(); this._m_ContainerDoubleAnimation$1.to = newLeft; if (this._m_LastZoomStartPos$1 != null) { this._m_LastZoomStartPos$1.x -= Math.round(newLeft - this.get_left()); } this._m_CanZoom$1 = false; (this._m_ContainerAnimation$1).begin(); var index = 0; var $enum1 = this._m_Markers$1.getEnumerator(); while ($enum1.moveNext()) { var marker = $enum1.get_current(); var markerWidth = Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer._markeR_WIDTH$1 * this._m_ScaleFactor$1; var doubleAnimationWidth = this.m_TargetControl.findName('_MarkerAnimationWidth_' + index); Coveo.CNL.Web.Scripts.CNLAssert.notNull(doubleAnimationWidth); (doubleAnimationWidth).from = marker.get_width(); (doubleAnimationWidth).to = markerWidth; var markerLeft = Math.min(Math.max(0, (marker.get_utterance().get_percent() * this.get_width()) - (markerWidth / 2)), this.get_width() - markerWidth); var doubleAnimationLeft = this.m_TargetControl.findName('_MarkerAnimationLeft_' + index); Coveo.CNL.Web.Scripts.CNLAssert.notNull(doubleAnimationLeft); (doubleAnimationLeft).from = marker.get_left(); (doubleAnimationLeft).to = markerLeft; var animation = this.m_TargetControl.findName('MarkerAnimation_' + index); Coveo.CNL.Web.Scripts.CNLAssert.notNull(animation); (animation).begin(); index++; } }, _marker_MouseEnter$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$_marker_MouseEnter$1(p_Sender, p_Args) { /// /// /// /// var conflict = false; if (this._m_ZoomOnMarkerConflict$1) { var currentMarkerLeft = (p_Sender).get_left(); var $enum1 = this._m_Markers$1.getEnumerator(); while ($enum1.moveNext()) { var marker = $enum1.get_current(); var markerLeft = marker.get_left(); if (((currentMarkerLeft < markerLeft) && ((currentMarkerLeft + Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer._markeR_WIDTH$1 / 2) > markerLeft)) || ((currentMarkerLeft > markerLeft) && ((markerLeft + Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer._markeR_WIDTH$1 / 2) > currentMarkerLeft))) { conflict = true; break; } } } if (conflict) { this._displayConflictRect$1(p_Args.getPosition(this.m_TargetControl), Coveo.CES.Web.Search.Scripts.Controls.Results.ZoomDirection.zoomIn); } var currentMarker = p_Sender; if (this.__utteranceHighlighted$1 != null) { this.__utteranceHighlighted$1.invoke(this, currentMarker.get_utterance()); } }, _marker_Click$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$_marker_Click$1(p_Sender, p_Args) { /// /// /// /// if (this.__utteranceClick$1 != null) { this.__utteranceClick$1.invoke(this, (p_Sender).get_utterance()); } }, _marker_MouseLeave$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$_marker_MouseLeave$1(p_Sender, p_Args) { /// /// /// /// if (this.__utteranceHighlighted$1 != null) { this.__utteranceHighlighted$1.invoke(this, null); } }, _markerConflictContainerMouseLeave$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$_markerConflictContainerMouseLeave$1(p_Sender, p_Args) { /// /// /// /// (this._m_ConflictFocusOutTimer$1).begin(); }, _containerAnimation_Completed$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$_containerAnimation_Completed$1(p_Sender, p_Args) { /// /// /// /// this.ensureBoudaries(); this._m_CanZoom$1 = true; if (this._m_DelayResetZoom$1) { this._renderFromScale$1(null); } }, _conflictFocusOut_Completed$1: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightTimeLineMarkerContainer$_conflictFocusOut_Completed$1(p_Sender, p_Args) { /// /// /// /// this._m_MarkerConflictContainer$1.setValue('Visibility', 'collapsed'); } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtterance Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtterance = function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtterance(p_Start, p_Percent, p_Excerpt) { /// /// This class contains all the information related to a media excerpt. /// /// /// Start time in seconds of the excerpt. /// /// /// Start time of the excerpt represented as a percentage /// /// /// The content of the excerpt. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.check(p_Start >= 0); Coveo.CNL.Web.Scripts.CNLAssert.check(p_Percent >= 0 && p_Percent <= 1); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Excerpt); this._m_Start = p_Start; this._m_Percent = p_Percent; this._m_Excerpt = p_Excerpt; } Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtterance.prototype = { _m_Start: 0, _m_Percent: 0, _m_Excerpt: null, _m_Data: null, m_OnUtteranceDivClick: null, m_OnUtteranceDivMouseOver: null, m_OnUtteranceDivMouseOut: null, get_start: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtterance$get_start() { /// /// Gets the start time of the excerpt in seconds. /// /// return this._m_Start; }, get_percent: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtterance$get_percent() { /// /// Gets the start time of the excerpt. /// /// return this._m_Percent; }, get_excerpt: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtterance$get_excerpt() { /// /// Gets the excerpt content. /// /// return this._m_Excerpt; }, get_data: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtterance$get_data() { /// /// Gets the user data object attached to the object. /// /// return this._m_Data; }, set_data: function Coveo_CES_Web_Search_Scripts_Controls_Results_SilverlightUtterance$set_data(value) { /// /// Gets the user data object attached to the object. /// /// this._m_Data = value; return value; } } Type.createNamespace('Coveo.CES.Web.Search.Scripts.Controls.SharePoint'); //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu = function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu() { /// /// This class represents the associated Javascript object for the control /// used to render the SharePoint contextual menus. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// Constant for ContextInfo verEnabled property. /// /// /// Constant for ContextInfo isForceCheckout property. /// /// /// Constant for ContextInfo EnableMinorVersions property. /// /// /// Constant for ContextInfo ContentTypesEnabled property. /// /// /// Constant for ContextInfo listBaseType property. /// /// /// Constant for ContextInfo listBaseTemplate property. /// /// /// Constant for ContextInfo WriteSecurity property. /// /// /// Constant for ContextInfo CurrentUserID property. /// /// /// Constant for item DRef attribute. /// Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.constructBase(this); } Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.prototype = { _m_OnMouseOver$1: null, _m_OnMouseOut$1: null, _m_OnDwellEvent$1: null, _m_Request$1: null, _m_IsBusy$1: false, _m_QueryDone$1: false, _m_MouseIsOver$1: false, _m_ContextIsInvalid$1: false, m_Target: null, m_SPTable: null, m_SPTableImage: null, m_SiteUri: null, m_ListId: null, m_ListItemId: null, m_ShowDelay: 0, m_BorderColor: null, m_FileName: null, initialize: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$initialize() { Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.callBase(this, 'initialize'); Coveo.CNL.Web.Scripts.CNLAssert.check(this.m_ShowDelay > 0); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_SPTable); this._m_OnDwellEvent$1 = new Coveo.CNL.Web.Scripts.OnDwellEvent(this.m_SPTable, this.m_ShowDelay, Delegate.create(this, this._spTable_OnDwell$1)); this._m_OnMouseOver$1 = Delegate.create(this, this._onMouseOver$1); this._m_OnMouseOut$1 = Delegate.create(this, this._onMouseOut$1); this.m_Target.attachEvent('onmouseover', this._m_OnMouseOver$1); this.m_Target.attachEvent('onmouseout', this._m_OnMouseOut$1); }, tearDown: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$tearDown() { this._m_OnDwellEvent$1.dispose(); this._m_OnDwellEvent$1 = null; this.m_Target.detachEvent('onmouseover', this._m_OnMouseOver$1); this.m_Target.detachEvent('onmouseout', this._m_OnMouseOut$1); this._m_Request$1 = null; Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.callBase(this, 'tearDown'); }, _spTable_OnDwell$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_spTable_OnDwell$1() { if (!this._m_QueryDone$1) { this._doBeforeMouseOver$1(); } }, _onMouseOver$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_onMouseOver$1() { this._m_MouseIsOver$1 = true; if (this._m_QueryDone$1) { this._handleSPOnItem$1(); } }, _onMouseOut$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_onMouseOut$1() { this._m_MouseIsOver$1 = !this._isMouseReallyOut$1(window.event, this.m_Target); if (!this._m_MouseIsOver$1) { this._resetBorder$1(); } }, _resetBorder$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_resetBorder$1() { /// /// Resets the table border after the menu has been displayed. This method /// is called after the mouse has exited the control area. However, when the /// menu is displayed, a timeout mecanism is started to automatically hide /// the menu since the mouse is already outside the control boundaries. /// if (this.m_SPTableImage.style.visibility === 'hidden') { var resetTimeOut = document.body.getAttribute(this.m_Target.id + 'ResetBorderTimeOut'); if (resetTimeOut != null) { window.clearTimeout(resetTimeOut); } document.body.removeAttribute(this.m_Target.id + 'ResetBorderTimeOut'); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(this.m_BorderColor); this.m_SPTable.style.borderLeftColor = this.m_BorderColor; this.m_SPTable.style.borderTopColor = this.m_BorderColor; this.m_SPTable.style.borderRightColor = this.m_BorderColor; this.m_SPTable.style.borderBottomColor = this.m_BorderColor; } else { document.body.setAttribute(this.m_Target.id + 'ResetBorderTimeOut', window.setTimeout(Delegate.create(this, this._resetBorder$1), 500)); } }, _isMouseReallyOut$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_isMouseReallyOut$1(p_Event, p_Target) { /// /// This function determines if the mouse is really outside the control /// boundaries. The mouseout event is triggered when the cursor /// pass from the current control to a child control and vice-versa. /// /// /// The triggered event. /// /// /// The element from which the event was triggered. /// /// var relatedTarget = p_Event.toElement; while (relatedTarget != null && relatedTarget !== p_Target) { relatedTarget = relatedTarget.parentNode; } return relatedTarget !== p_Target; }, _doBeforeMouseOver$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_doBeforeMouseOver$1() { /// /// Prefetch contextual menu information from the installed service. /// if (this._m_IsBusy$1) { return; } this._m_IsBusy$1 = true; if (this._m_Request$1 == null) { this._m_Request$1 = new XMLHttpRequest(); this._m_Request$1.onreadystatechange = Delegate.create(this, this._onRequestComplete$1); } this._m_Request$1.open('GET', String.format(this.m_SiteUri + '/_layouts/CES/AttributesSelector.aspx?ListItemId={0}&ListId={1}&Dummy={2}', this.m_ListItemId, this.m_ListId, Date.get_now().toString()), true); this._m_Request$1.send(null); }, _onRequestComplete$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_onRequestComplete$1() { /// /// Update the control with the contextual menu informations received from /// the installed service. /// if (this._m_Request$1.readyState === 4) { this._m_QueryDone$1 = true; var response = this._m_Request$1.responseText; var xml = XMLDocumentParser.parse(response); var versionNode = xml.selectSingleNode('/ItemAttributes/Version'); if ((versionNode == null) || (versionNode.attributes.getNamedItem('Value').text !== Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu._VERSION$1)) { this._m_ContextIsInvalid$1 = true; return; } var errorNode = xml.selectSingleNode('/ItemAttributes/Error'); if (errorNode != null) { this._m_ContextIsInvalid$1 = true; return; } var nodes = xml.selectNodes('/ItemAttributes/ItemAttribute'); for (var i = 0; i <= nodes.length - 1; i++) { var node = nodes[i]; var fieldName = node.attributes.getNamedItem('FieldName').text; var value = node.attributes.getNamedItem('Value').text; if (fieldName === Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_VERSION_ENABLED) { eval('var setEnabledVersion = new Function(\"' + this.m_SPTable.getAttribute('CTXName') + '.verEnabled = ' + value + ';\"); setEnabledVersion();'); } else if (fieldName === Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_IS_FORCE_CHECKOUT) { eval('var setIsForceCheckout = new Function(\"' + this.m_SPTable.getAttribute('CTXName') + '.isForceCheckout = ' + value + ';\"); setIsForceCheckout();'); } else if (fieldName === Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_ENABLE_MINOR_VERSIONS) { eval('var setEnableMinorVersions = new Function(\"' + this.m_SPTable.getAttribute('CTXName') + '.EnableMinorVersions = ' + value + ';\"); setEnableMinorVersions();'); } else if (fieldName === Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_CONTENT_TYPES_ENABLED) { eval('var setContentTypesEnabled = new Function(\"' + this.m_SPTable.getAttribute('CTXName') + '.ContentTypesEnabled = ' + value + ';\"); setContentTypesEnabled();'); } else if (fieldName === Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_BASE_TYPE) { eval('var setListBaseType = new Function(\"' + this.m_SPTable.getAttribute('CTXName') + '.listBaseType = ' + value + ';\"); setListBaseType();'); } else if (fieldName === Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_BASE_TEMPLATE) { eval('var setListBaseTemplate = new Function(\"' + this.m_SPTable.getAttribute('CTXName') + '.listTemplate = ' + value + ';\"); setListBaseTemplate();'); } else if (fieldName === Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_WRITE_SECURITY) { eval('var setWriteSecurity = new Function(\"' + this.m_SPTable.getAttribute('CTXName') + '.WriteSecurity = ' + value + ';\"); setWriteSecurity();'); } else if (fieldName === Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_USER_ID) { eval('var setUserID = new Function(\"' + this.m_SPTable.getAttribute('CTXName') + '.CurrentUserID = ' + value + ';\"); setUserID();'); } else if (fieldName === Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.d_REF) { var url = value; if (!url.startsWith('/')) { url = url.insert(0, '/'); } if (!url.endsWith('/')) { url += '/'; } url += this.m_FileName; this.m_SPTable.setAttribute('Url', url); this.m_SPTable.setAttribute(fieldName, value); } else { this.m_SPTable.setAttribute(fieldName, value); } } this._m_IsBusy$1 = false; if (this._m_MouseIsOver$1) { this._handleSPOnItem$1(); } } }, _handleSPOnItem$1: function Coveo_CES_Web_Search_Scripts_Controls_SharePoint_ResultContextualMenu$_handleSPOnItem$1() { /// /// Call the SharePoint Javascript method that renders the contextual menu. /// if (!this._m_ContextIsInvalid$1) { this.m_SPTable.style.borderLeftColor = Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu._sP_MENU_COLOR$1; this.m_SPTable.style.borderTopColor = Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu._sP_MENU_COLOR$1; this.m_SPTable.style.borderRightColor = Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu._sP_MENU_COLOR$1; this.m_SPTable.style.borderBottomColor = Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu._sP_MENU_COLOR$1; OnItem(this.m_SPTable); } } } Type.createNamespace('Coveo.CES.Web.Search.Scripts'); //////////////////////////////////////////////////////////////////////////////// // Coveo.CES.Web.Search.Scripts.SharePointItemUtilities Coveo.CES.Web.Search.Scripts.SharePointItemUtilities = function Coveo_CES_Web_Search_Scripts_SharePointItemUtilities() { /// /// Client side code for the SearchControl control. /// } Coveo.CES.Web.Search.Scripts.SharePointItemUtilities.viewDocument = function Coveo_CES_Web_Search_Scripts_SharePointItemUtilities$viewDocument(p_Uri, p_Window) { /// /// Opens a SharePoint document for viewing. /// /// /// The uri of the document to open. /// /// /// The window that opens the document. /// var res = false; var obj = Coveo.CES.Web.Search.Scripts.SharePointItemUtilities._getOpenDocuments(); if (obj != null) { try { res = obj.viewDocument2(p_Window, p_Uri); } catch ($e1) { try { res = obj.viewDocument(p_Uri); } catch ($e2) { res = false; } } } if (obj == null || !res) { p_Window.navigate(p_Uri); } } Coveo.CES.Web.Search.Scripts.SharePointItemUtilities.editDocument = function Coveo_CES_Web_Search_Scripts_SharePointItemUtilities$editDocument(p_Uri, p_Window) { /// /// Opens a SharePoint document for editing. /// /// /// The uri of the document to open. /// /// /// The window that opens the document. /// var obj = Coveo.CES.Web.Search.Scripts.SharePointItemUtilities._getOpenDocuments(); if (obj != null) { try { obj.editDocument2(p_Window, p_Uri); } catch ($e1) { obj.editDocument(p_Uri); } } else { Coveo.CES.Web.Search.Scripts.SharePointItemUtilities.viewDocument(p_Uri, p_Window); } } Coveo.CES.Web.Search.Scripts.SharePointItemUtilities._getOpenDocuments = function Coveo_CES_Web_Search_Scripts_SharePointItemUtilities$_getOpenDocuments() { /// /// Attempts to create an SharePoint.OpenDocuments object. /// /// var obj; try { obj = new ActiveXObject('SharePoint.OpenDocuments.2'); } catch ($e1) { try { obj = new ActiveXObject('SharePoint.OpenDocuments.1'); } catch ($e2) { try { obj = new ActiveXObject('SharePoint.OpenDocuments'); } catch ($e3) { obj = null; } } } return obj; } Coveo.CES.Web.Search.Scripts.Controls.FacetScript.createClass('Coveo.CES.Web.Search.Scripts.Controls.FacetScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript); Coveo.CES.Web.Search.Scripts.Controls.ContextualDropDownScript.createClass('Coveo.CES.Web.Search.Scripts.Controls.ContextualDropDownScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript); Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript.createClass('Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript); Coveo.CES.Web.Search.Scripts.Controls.CloseModalBoxLinkScript.createClass('Coveo.CES.Web.Search.Scripts.Controls.CloseModalBoxLinkScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript); Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript.createClass('Coveo.CES.Web.Search.Scripts.Controls.SharePointSearchBoxScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript); Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript.createClass('Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript); Coveo.CES.Web.Search.Scripts.Controls.PrefetchTermScript.createClass('Coveo.CES.Web.Search.Scripts.Controls.PrefetchTermScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript); Coveo.CES.Web.Search.Scripts.Controls.QueryScript.createClass('Coveo.CES.Web.Search.Scripts.Controls.QueryScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript); Coveo.CES.Web.Search.Scripts.Controls.HighlightedQueryScript.createClass('Coveo.CES.Web.Search.Scripts.Controls.HighlightedQueryScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript); Coveo.CES.Web.Search.Scripts.Controls.ResultPrintableUriScript.createClass('Coveo.CES.Web.Search.Scripts.Controls.ResultPrintableUriScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript); Coveo.CES.Web.Search.Scripts.Controls.ViewAsHtmlPanelScript.createClass('Coveo.CES.Web.Search.Scripts.Controls.ViewAsHtmlPanelScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl'); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry); Coveo.CES.Web.Search.Scripts.Controls.Results.TextContainerEventArgs.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.TextContainerEventArgs', EventArgs); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextContainer', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButton.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButton', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButton); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightDebug.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightDebug', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightExcerptTooltip', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayerControl.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayerControl', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayPauseButton', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightAnimatedButton); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightProgress', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightSymbolButton', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightButton); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextTime.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextTime', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer', Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl); Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtterance.createClass('Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtterance'); Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.createClass('Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript); Coveo.CES.Web.Search.Scripts.SharePointItemUtilities.createClass('Coveo.CES.Web.Search.Scripts.SharePointItemUtilities'); Coveo.CES.Web.Search.Scripts.Controls.SearchControlScript._s_Instances$1 = {}; Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript.querY_PARAMETER = null; Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript.initiaL_SCOPE_PARAMETER = null; Coveo.CES.Web.Search.Scripts.Controls.SearchBoxScript.timE_ZONE_OFFSET_PARAMETER = null; Coveo.CES.Web.Search.Scripts.Controls.PrefetchTermScript._prefetcH_DELAY$1 = 600; Coveo.CES.Web.Search.Scripts.Controls.PrefetchTermScript._s_PrefetchedTerms$1 = []; Coveo.CES.Web.Search.Scripts.Controls.QueryScript._prefetcH_DELAY$1 = 600; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry._mousE_ENTER_TEXT_COLOR$2 = 'Black'; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry._mousE_LEAVE_TEXT_COLOR$2 = 'White'; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry._selecteD_COLOR$2 = '#FFD3D3D3'; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightUtteranceTextEntry._selecteD_TEXT_COLOR$2 = 'Black'; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTextEntry._selecteD_TEXT_COLOR$1 = '#FFF1922A'; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightScrollArea._scrolL_MOVE_SIZE$1 = 50; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightCustomControl._draG_MOUSE_THRESHOLD = 3; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightPlayerControl.unablE_TO_PLAY_ERROR = null; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker._mousE_ENTER_COLOR$1 = 'Lime'; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarker._mousE_LEAVE_COLOR$1 = '#FF5D5A5A'; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer._markeR_WIDTH$1 = 9; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer._markeR_HEIGHT$1 = 13; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer._markeR_TOP$1 = 0; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer._conflicT_SIDE_RANGE_LOOKUP$1 = 50; Coveo.CES.Web.Search.Scripts.Controls.Results.SilverlightTimeLineMarkerContainer._zooM_SCALE$1 = 6; Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu._VERSION$1 = '5.0.200708161'; Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu._sP_MENU_COLOR$1 = '#b09460'; Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_VERSION_ENABLED = null; Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_IS_FORCE_CHECKOUT = null; Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_ENABLE_MINOR_VERSIONS = null; Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_CONTENT_TYPES_ENABLED = null; Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_BASE_TYPE = null; Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_BASE_TEMPLATE = null; Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_WRITE_SECURITY = null; Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.lisT_USER_ID = null; Coveo.CES.Web.Search.Scripts.Controls.SharePoint.ResultContextualMenu.d_REF = null; // ---- Do not remove this footer ---- // This script was generated using Script# v0.5.5.0 (http://projects.nikhilk.net/ScriptSharp) // ----------------------------------- //**************************************************************************** // Copyright (c) 2005, Coveo Solutions Inc. //**************************************************************************** function CES_CachedDocument() { // PUBLIC INTERFACE //**************************************************************************** // Opens the currently displayed document in a new window. //**************************************************************************** this.OpenInNewWindow = function() { window.open(this.m_Uri, this.m_Uri.indexOf('outlook:') == 0 ? '_self' : '_blank'); } //**************************************************************************** // Opens the currently displayed view as html in a new window. //**************************************************************************** this.OpenViewAsHtmlInNewWindow = function() { window.open(this.src, '_blank'); } //**************************************************************************** // Highlights the next occurence of a term. // p_Term - The index of the term to highlight. //**************************************************************************** this.HighlightNextOccurence = function(p_Term) { if (!this.m_DoNotHighlight) { this.RemoveLastHighlight(); var last = this.m_Positions[p_Term]; if (last == undefined) { last = 0; } var current = last + 1; if (this.GetTermPart(p_Term, current, 1) == null) { current = 1; } this.HighlightTerm(p_Term, current); this.m_Positions[p_Term] = current; } } //**************************************************************************** // Highlights the previous occurence of a term. // p_Term - The index of the term to highlight. //**************************************************************************** this.HighlightPreviousOccurence = function(p_Term) { if (!this.m_DoNotHighlight) { this.RemoveLastHighlight(); var last = this.m_Positions[p_Term]; if (last == undefined) { last = 1; } var current = last - 1; if (this.GetTermPart(p_Term, current, 1) == null) { // Skip to the last one current = 1; while (this.GetTermPart(p_Term, current, 1) != null) { ++current; } --current; } this.HighlightTerm(p_Term, current); this.m_Positions[p_Term] = current; } } // PRIVATE INTERFACE //**************************************************************************** // Resets the members used to track the current highlight. //**************************************************************************** this.ResetMembers = function() { this.m_Positions = new Array(); this.m_LastTerm = 0; this.m_LastOccurence = 0; this.m_DoNotHighlight = false; } //**************************************************************************** // Retrieves the document object inside the frame. //**************************************************************************** this.GetDocument = function() { return frames[this.name].document; } //**************************************************************************** // Retrieves a specific highlight part. // p_Term - The index of the term. // p_Occurence - The index of the occurence of the term. // p_Part - The index of the part of the term. //**************************************************************************** this.GetTermPart = function(p_Term, p_Occurence, p_Part) { return this.GetDocument().getElementById('CoveoHighlight:' + p_Term + '.' + p_Occurence + '.' + p_Part); } //**************************************************************************** // Highlights a term and scrolls it into view. // p_Term - The index of the term to highlight. // p_Occurence - The index of the term occurence to highlight. //**************************************************************************** this.HighlightTerm = function(p_Term, p_Occurence) { var part = 1; var elem = this.GetTermPart(p_Term, p_Occurence, part); if (elem != null) { elem.scrollIntoView(); while (elem != null) { elem.m_BackupColor = elem.style.color; elem.m_BackupBackground = elem.style.backgroundColor; elem.style.color = 'white'; elem.style.backgroundColor = 'green'; elem = this.GetTermPart(p_Term, p_Occurence, ++part); } this.m_LastTerm = p_Term; this.m_LastOccurence = p_Occurence; // FireFox 1.5.0.2 has a bug with scrollIntoView document.documentElement.scrollTop = 0; } } //**************************************************************************** // Unhighlights the last highlighted term. //**************************************************************************** this.RemoveLastHighlight = function() { if (this.m_LastTerm != 0) { var part = 1; var elem = this.GetTermPart(this.m_LastTerm, this.m_LastOccurence, part); while (elem != null) { elem.style.color = elem.m_BackupColor; elem.style.backgroundColor = elem.m_BackupBackground; elem = this.GetTermPart(this.m_LastTerm, this.m_LastOccurence, ++part); } } } } // Constructor //**************************************************************************** // Copyright (c) 2006, Coveo Solutions Inc. //**************************************************************************** function CES_Player() { var m_LastPositions = new Array(); var m_LastTerm = 0; var m_LastOccurence = 0; var m_LastCurrentWord = null; //**************************************************************************** // Handler for the onclick event of the utterances link. //**************************************************************************** this.UtterancesLink_OnClick = function() { this.ShowUtterances(); } //**************************************************************************** // Handler for the onclick event of the transcript link. //**************************************************************************** this.TranscriptLink_OnClick = function() { this.ShowTranscript(); } //**************************************************************************** // Handler for the onclick event of the timeline. //**************************************************************************** this.TimeLine_OnClick = function(p_Event) { var tlpos = CNL_GetPosition(this.m_TimeLine); var tlsize = CNL_GetSize(this.m_TimeLine); var percent = (p_Event.x - tlpos.m_Left) / tlsize.m_Width; this.Jump(this.m_Length * percent); } //**************************************************************************** // Handler for the onclick event on the play button. //**************************************************************************** this.Play_OnClick = function(p_Event) { this.m_Player.controls.play(); this.Synchronize(false); } //**************************************************************************** // Handler for the onclick event on the pause button. //**************************************************************************** this.Pause_OnClick = function(p_Event) { this.m_Player.controls.pause(); this.Synchronize(false); } //**************************************************************************** // Shows the utterances tab. //**************************************************************************** this.ShowUtterances = function() { this.m_UtterancesLink.style.fontWeight = 'bold'; this.m_UtterancesLink.style.backgroundColor = 'silver'; this.m_TranscriptLink.style.fontWeight = 'normal'; this.m_TranscriptLink.style.backgroundColor = 'whitesmoke'; this.m_Utterances.style.display = 'block'; this.m_Transcript.style.display = 'none'; } //**************************************************************************** // Shows the transcript tab. //**************************************************************************** this.ShowTranscript = function() { this.m_UtterancesLink.style.fontWeight = 'normal'; this.m_UtterancesLink.style.backgroundColor = 'whitesmoke'; this.m_TranscriptLink.style.fontWeight = 'bold'; this.m_TranscriptLink.style.backgroundColor = 'silver'; this.m_Utterances.style.display = 'none'; this.m_Transcript.style.display = 'block'; this.Synchronize(false); } //**************************************************************************** // Highlights the next occurence of a term. // p_Term - The index of the term to highlight. //**************************************************************************** this.HighlightNextOccurence = function(p_Term) { this.ShowTranscript(); this.RemoveLastHighlight(); var last = m_LastPositions[p_Term]; if (last == undefined) { last = 0; } var current = last + 1; if (this.GetTermPart(p_Term, current, 1) == null) { current = 1; } this.HighlightTerm(p_Term, current); m_LastPositions[p_Term] = current; } //**************************************************************************** // Highlights the previous occurence of a term. // p_Term - The index of the term to highlight. //**************************************************************************** this.HighlightPreviousOccurence = function(p_Term) { this.ShowTranscript(); this.RemoveLastHighlight(); var last = m_LastPositions[p_Term]; if (last == undefined) { last = 1; } var current = last - 1; if (this.GetTermPart(p_Term, current, 1) == null) { // Skip to the last one current = 1; while (this.GetTermPart(p_Term, current, 1) != null) { ++current; } --current; } this.HighlightTerm(p_Term, current); m_LastPositions[p_Term] = current; } //**************************************************************************** // Creates the media player within the page. // p_Uri - The uri to load within the media player. // p_Start - The position of the first utterance. //**************************************************************************** this.CreateMediaPlayer = function(p_Uri, p_Start) { // Create the media player (visible or not) var elem = document.createElement('object'); if (this.m_Video) { elem.style.width = this.m_Player.style.width; elem.style.height = this.m_Player.style.height; this.m_Player.replaceNode(elem); } else { this.m_Player.appendChild(elem); elem.style.display = 'none'; } // Setup the player. I configure it to use windowless video so that we can // put stuff over the player. This make certains rare codecs unable to play, // but this ain't a problem since we're converting the clips to a known format. this.m_Player = elem; elem.classid = 'CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'; elem.stretchToFit = true; elem.windowlessVideo = true; elem.uiMode = 'none'; elem.URL = p_Uri; this.Jump(this.GetHeadStart(p_Start)); // Arm the timer that constantly synchronizes the position of the player this.Synchronize(true); } //**************************************************************************** // Adds an utterance to the various displays. // p_Start - The start time of the utterance. // p_Percent - The position expressed as a percentage. // p_Html - The html for displaying info about the utterance. //**************************************************************************** this.AddUtterance = function(p_Start, p_Percent, p_Html) { // Create the entry in the utterances var utelem = document.createElement('div'); utelem.className = 'CesUnselectedMenuItem'; utelem.style.cursor = 'pointer'; utelem.innerHTML = p_Html; this.m_Utterances.appendChild(utelem); // Create the bar in the timeline var tlpos = CNL_GetPosition(this.m_TimeLine); var tlsize = CNL_GetSize(this.m_TimeLine); var tlelem = document.createElement('img'); tlelem.src = this.m_UtteranceUri; tlelem.style.position = 'absolute'; tlelem.style.cursor = 'pointer'; tlelem.style.zIndex = '800'; this.m_TimeLine.appendChild(tlelem); CNL_SetPosition(tlelem, tlpos.m_Left + tlsize.m_Width * p_Percent - 6, tlpos.m_Top + 3); // Create the tooltip for the timeline bar var ttelem = document.createElement('div'); ttelem.style.position = 'absolute'; ttelem.style.width = '500px'; ttelem.style.border = '1px solid black'; ttelem.style.backgroundColor = 'whitesmoke'; ttelem.style.padding = '5px'; ttelem.style.zIndex = '999'; ttelem.innerHTML = p_Html; this.m_TimeLine.appendChild(ttelem); CNL_PositionObject(ttelem, tlelem, 'AboveLeft'); ttelem.style.visibility = 'hidden'; // Setup event handlers var myself = this; utelem.onmouseover = function() { utelem.className = 'CesSelectedMenuItem'; tlelem.src = myself.m_UtteranceSelectedUri; }; utelem.onmouseout = function() { utelem.className = 'CesUnselectedMenuItem'; tlelem.src = myself.m_UtteranceUri; }; utelem.onclick = function() { myself.Jump(myself.GetHeadStart(p_Start)); } tlelem.onmouseover = function() { utelem.style.backgroundColor = 'lightgrey'; tlelem.src = myself.m_UtteranceSelectedUri; ttelem.style.visibility = 'visible'; }; tlelem.onmouseout = function() { utelem.style.backgroundColor = ''; tlelem.src = myself.m_UtteranceUri; ttelem.style.visibility = 'hidden'; }; } //**************************************************************************** // Jumps to a given position within the clip. // p_Position - The position to which to jump. //**************************************************************************** this.Jump = function(p_Position) { this.m_Player.controls.currentPosition = p_Position; this.m_Player.controls.play(); //this.Synchronize(false); } //**************************************************************************** // Synchronizes the currently highlighted word with the position of the player. // p_Auto - Whether the call comes from the timer. //**************************************************************************** this.Synchronize = function(p_Auto) { // If we get called while the page is unloading, we should not attempt to // touch the media player as it mail trigger exceptions. if (!this.m_Player.controls) { return; } // Try to detect when the code for the player was replaced with newer one // (happens when using partial postbacks). If we detect this, stop the player. var found = false; var up = this.parentElement; while (up != null) { if (up.tagName == 'BODY') { found = true; break; } up = up.parentElement; } if (!found) { this.m_Player.controls.stop(); this.m_Utterances = null; this.m_Transcript = null; this.m_Player = null; this.m_TimeLine = null; this.m_Play = null; this.m_Pause = null; this.m_Slider = null; this.m_Filler = null; this.m_Status = null; return; } // Update the status of the buttons switch (this.m_Player.playState) { case 3: this.m_Play.style.display = 'none'; this.m_Pause.style.display = 'inline'; this.m_Status.innerHTML = ''; break; case 6: this.m_Play.style.display = 'none'; this.m_Pause.style.display = 'inline'; this.m_Status.innerHTML = this.m_Player.status; break; default: this.m_Play.style.display = 'inline'; this.m_Pause.style.display = 'none'; this.m_Status.innerHTML = ''; break; } // Update the position of the slider var slsize = CNL_GetSize(this.m_Slider); var position = this.m_Player.controls.currentPosition; var spos = this.GetTimeLinePosition(position / this.m_Length); CNL_SetPosition(this.m_Slider, spos.m_Left - slsize.m_Width / 2, spos.m_Top - 8); // Update the filler var tlpos = CNL_GetPosition(this.m_TimeLine); var tlsize = CNL_GetSize(this.m_TimeLine); CNL_SetPosition(this.m_Filler, tlpos.m_Left - 2, tlpos.m_Top + 3); this.m_Filler.style.width = (spos.m_Left - tlpos.m_Left + 2) + 'px'; var delay; if (this.m_Transcript) { // Unhighlight the last word if (m_LastCurrentWord != null) { m_LastCurrentWord.style.color = m_LastCurrentWord.m_BackupColor; m_LastCurrentWord.style.backgroundColor = m_LastCurrentWord.m_BackupBackground; } // Find the index of the current word (eg. the one before the one that is // starting at the nearest time after the current position). var beg = 0; var end = this.m_Positions.length; var index = 0; while (beg < end) { index = beg + Math.floor((end - beg) / 2); var value = this.m_Positions[index]; if (value < position) { beg = index + 1; } else { end = index; } } index = Math.max(beg - 1, 0); // If a word was found highlight it m_LastCurrentWord = G(this.id + '_' + this.m_Positions[index]); if (m_LastCurrentWord != null) { m_LastCurrentWord.m_BackupColor = m_LastCurrentWord.style.color; m_LastCurrentWord.m_BackupBackground = m_LastCurrentWord.style.backgroundColor; m_LastCurrentWord.style.color = 'white'; m_LastCurrentWord.style.backgroundColor = 'maroon'; // When doing an explicit (eg. non-auto) synchronize, we want // to scroll the transcript so that the current word is displayed. if (!p_Auto) { m_LastCurrentWord.scrollIntoView(); } } // Compute the delay till the next word if (this.m_Positions[index] > position) { delay = (this.m_Positions[index] - position) * 1000; } else if (index + 1 < this.m_Positions.length) { delay = (this.m_Positions[index + 1] - position) * 1000; } else { delay = 1000; } if (delay > 500) { delay = 500; } } else { delay = 500; } // Rearm the timer if needed if (p_Auto) { var myself = this; setTimeout(function() { myself.Synchronize(true); }, delay); } } //**************************************************************************** // Retrieves the position at which to jump for an utterance, including a head start. // p_Start - The position at which the utterance starts. // Returns the position with the headstart. //**************************************************************************** this.GetHeadStart = function(p_Start) { var pos = p_Start - this.m_HeadStart; if (pos < 0) { pos = 0; } return pos; } //**************************************************************************** // Retrieves the position of a point on the timeline. // p_Percent - The percentage of the point on the timeline. // Returns an object holding the position. //**************************************************************************** this.GetTimeLinePosition = function(p_Percent) { var tlpos = CNL_GetPosition(this.m_TimeLine); var tlsize = CNL_GetSize(this.m_TimeLine); tlpos.m_Left += tlsize.m_Width * p_Percent - 2; return tlpos; } //**************************************************************************** // Retrieves a specific highlight part. // p_Term - The index of the term. // p_Occurence - The index of the occurence of the term. // p_Part - The index of the part of the term. //**************************************************************************** this.GetTermPart = function(p_Term, p_Occurence, p_Part) { return document.getElementById('CoveoHighlight:' + p_Term + '.' + p_Occurence + '.' + p_Part); } //**************************************************************************** // Highlights a term and scrolls it into view. // p_Term - The index of the term to highlight. // p_Occurence - The index of the term occurence to highlight. //**************************************************************************** this.HighlightTerm = function(p_Term, p_Occurence) { var part = 1; var elem = this.GetTermPart(p_Term, p_Occurence, part); if (elem != null) { // Jump to the position of this word var time = parseFloat(elem.parentNode.id.substring(this.id.length + 1, elem.parentNode.id.length)); this.Jump(time); elem.scrollIntoView(); while (elem != null) { elem.m_BackupColor = elem.style.color; elem.m_BackupBackground = elem.style.backgroundColor; elem.style.color = 'white'; elem.style.backgroundColor = 'green'; elem = this.GetTermPart(p_Term, p_Occurence, ++part); } m_LastTerm = p_Term; m_LastOccurence = p_Occurence; } } //**************************************************************************** // Unhighlights the last highlighted term. //**************************************************************************** this.RemoveLastHighlight = function() { if (m_LastTerm != 0) { var part = 1; var elem = this.GetTermPart(m_LastTerm, m_LastOccurence, part); while (elem != null) { elem.style.color = elem.m_BackupColor; elem.style.backgroundColor = elem.m_BackupBackground; elem = this.GetTermPart(m_LastTerm, m_LastOccurence, ++part); } } } } // Constructor